|
|
@ -15,88 +15,49 @@ import kotlin.test.assertEquals |
|
|
|
|
|
|
|
|
|
|
|
class CSSBorderTests { |
|
|
|
class CSSBorderTests { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
fun border() = runTest { |
|
|
|
|
|
|
|
composition { |
|
|
|
|
|
|
|
Div({ style { property("border", "1px solid red") } }) |
|
|
|
|
|
|
|
Div({ style { border(3.px, color = Color("green")) } }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals("1px solid red", (root.children[0] as HTMLElement).style.border) |
|
|
|
|
|
|
|
root.children[1]?.let { |
|
|
|
|
|
|
|
val el = it.unsafeCast<HTMLElement>() |
|
|
|
|
|
|
|
assertEquals("green", el.style.getPropertyValue("border-color")) |
|
|
|
|
|
|
|
assertEquals("3px", el.style.getPropertyValue("border-width")) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
fun borderRadius() = runTest { |
|
|
|
fun borderRadius() = runTest { |
|
|
|
composition { |
|
|
|
composition { |
|
|
|
Div( |
|
|
|
Div({ style { borderRadius(3.px) } }) |
|
|
|
{ |
|
|
|
Div({ style { borderRadius(3.px, 5.px) } }) |
|
|
|
style { |
|
|
|
Div({ style { borderRadius(3.px, 5.px, 4.px) } }) |
|
|
|
borderRadius(3.px) |
|
|
|
Div({ style { borderRadius(3.px, 5.px, 4.px, 1.px) } }) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
Div( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
style { |
|
|
|
|
|
|
|
borderRadius(3.px, 5.px) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
Div( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
style { |
|
|
|
|
|
|
|
borderRadius(3.px, 5.px, 4.px) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
Div( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
style { |
|
|
|
|
|
|
|
borderRadius(3.px, 5.px, 4.px, 1.px) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assertEquals("3px", (root.children[0] as HTMLElement).style.borderRadius) |
|
|
|
assertEquals("3px", (root.children[0] as HTMLElement).style.borderRadius) |
|
|
|
assertEquals("3px 5px", (root.children[1] as HTMLElement).style.borderRadius) |
|
|
|
assertEquals("3px 5px", (root.children[1] as HTMLElement).style.borderRadius) |
|
|
|
assertEquals("3px 5px 4px", (root.children[2] as HTMLElement).style.borderRadius) |
|
|
|
assertEquals("3px 5px 4px", (root.children[2] as HTMLElement).style.borderRadius) |
|
|
|
assertEquals( |
|
|
|
assertEquals("3px 5px 4px 1px", (root.children[3] as HTMLElement).style.borderRadius) |
|
|
|
"3px 5px 4px 1px", |
|
|
|
|
|
|
|
(root.children[3] as HTMLElement).style.borderRadius |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
fun borderWidth() = runTest { |
|
|
|
fun borderWidth() = runTest { |
|
|
|
composition { |
|
|
|
composition { |
|
|
|
Div( |
|
|
|
Div({ style { borderWidth(2.px) } }) |
|
|
|
{ |
|
|
|
Div({ style { borderWidth(3.px, 7.px) } }) |
|
|
|
style { |
|
|
|
Div({ style { borderWidth(3.px, 5.px, 4.px) } }) |
|
|
|
borderWidth(2.px) |
|
|
|
Div({ style { borderWidth(3.px, 5.px, 4.px, 2.px) } }) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
Div( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
style { |
|
|
|
|
|
|
|
borderWidth(3.px, 7.px) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
Div( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
style { |
|
|
|
|
|
|
|
borderWidth(3.px, 5.px, 4.px) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
Div( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
style { |
|
|
|
|
|
|
|
borderWidth(3.px, 5.px, 4.px, 2.px) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assertEquals("2px", (root.children[0] as HTMLElement).style.borderWidth) |
|
|
|
assertEquals("2px", (root.children[0] as HTMLElement).style.borderWidth) |
|
|
|
assertEquals("3px 7px", (root.children[1] as HTMLElement).style.borderWidth) |
|
|
|
assertEquals("3px 7px", (root.children[1] as HTMLElement).style.borderWidth) |
|
|
|
assertEquals("3px 5px 4px", (root.children[2] as HTMLElement).style.borderWidth) |
|
|
|
assertEquals("3px 5px 4px", (root.children[2] as HTMLElement).style.borderWidth) |
|
|
|
assertEquals( |
|
|
|
assertEquals("3px 5px 4px 2px", (root.children[3] as HTMLElement).style.borderWidth) |
|
|
|
"3px 5px 4px 2px", |
|
|
|
|
|
|
|
(root.children[3] as HTMLElement).style.borderWidth |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |