Skip to content

Commit

Permalink
feat(tests): Verify parent navigation works if removed
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza committed Jul 24, 2024
1 parent fe14d24 commit 029a3f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/com/github/olivergondza/saxeed/SaxeedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ void unwrap() {
);

assertEquals("<a>keepkeep<child></child><another><foo></foo>keep</another>keep</a>", actual);

// Verify unwrapped parent/root tag still shows as parent to its children
actual = Util.transform("<r><ch/></r>", start -> {
if (start.isNamed("r")) {
start.unwrap();
} else if (start.isNamed("ch")) {
assertEquals("r", start.getParent().getName().getLocal());
assertEquals("r", start.getParent("r").getName().getLocal());
}
}, "r", "ch");

assertEquals("<ch></ch>", actual);
}

@Test
Expand Down

0 comments on commit 029a3f1

Please sign in to comment.