Skip to content

Commit

Permalink
one more test for parentRule (see #45)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Nov 2, 2023
1 parent 5853326 commit 4b424ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/org/htmlunit/cssparser/dom/CSSStyleRuleImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.htmlunit.cssparser.dom;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.io.StringReader;

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

/**
* @throws Exception if any error occurs
*/
@Test
public void parentRule() throws Exception {
final CSSStyleRuleImpl value = parseStyleRule("h1 { color: blue; background: green }");
final CSSStyleDeclarationImpl style = value.getStyle();

assertNull(value.getParentRule());
assertEquals(value, style.getParentRule());
}

/**
* @throws Exception if any error occurs
*/
Expand Down

0 comments on commit 4b424ed

Please sign in to comment.