Skip to content

Commit 4b424ed

Browse files
committed
one more test for parentRule (see #45)
1 parent 5853326 commit 4b424ed

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/java/org/htmlunit/cssparser/dom/CSSStyleRuleImplTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package org.htmlunit.cssparser.dom;
1616

1717
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertNull;
1819

1920
import java.io.StringReader;
2021

@@ -40,6 +41,18 @@ public void getCssText() throws Exception {
4041
assertEquals("h1 { color: blue; }", value.toString());
4142
}
4243

44+
/**
45+
* @throws Exception if any error occurs
46+
*/
47+
@Test
48+
public void parentRule() throws Exception {
49+
final CSSStyleRuleImpl value = parseStyleRule("h1 { color: blue; background: green }");
50+
final CSSStyleDeclarationImpl style = value.getStyle();
51+
52+
assertNull(value.getParentRule());
53+
assertEquals(value, style.getParentRule());
54+
}
55+
4356
/**
4457
* @throws Exception if any error occurs
4558
*/

0 commit comments

Comments
 (0)