File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/scala/com/raquo/domtestutils/matching Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ class TestableStyleProp[V](val name: String) {
1313 testNode.addCheck(nodeStyleIs(expectedValue.toString))
1414 }
1515
16+ def isEmpty : Rule = (testNode : ExpectedNode ) => {
17+ // #TODO[Integrity] Not 100% sure that this is reliable, but as far as I can tell, should work with our `getStyle` funciton.
18+ testNode.addCheck(nodeStyleIs(" " ))
19+ }
20+
1621 private [domtestutils] def nodeStyleIs (expectedValue : String )(node : dom.Node ): MaybeError = {
1722 val actualValue = getStyle(node)
1823
@@ -46,7 +51,7 @@ class TestableStyleProp[V](val name: String) {
4651 .selectDynamic(" style" )
4752 .asInstanceOf [js.UndefOr [CSSStyleDeclaration ]]
4853 .flatMap { css =>
49- css.getPropertyValue(name)
54+ css.getPropertyValue(name) // if not set, returns empty string
5055 }
5156 .toOption
5257 .getOrElse(" " )
You can’t perform that action at this time.
0 commit comments