Skip to content

Commit 09616e3

Browse files
committed
Add a test to validate the structure of the heading nav
This checks the entire structure of the heading nav for this test. It currently is not handling nesting properly. Having a large inline string like this may not be the easiest to maintain or be able to see the structure. I don't see a way to format it in goml.
1 parent 8385e75 commit 09616e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/gui/heading-nav-collapsed.goml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ assert-text: (".current-header", "Heading 1")
1010
assert-attribute: ("li:has(> span > a[href='#heading-12'])", {"class": "header-item"})
1111
assert-attribute: ("li:has(> span > a[href='#heading-21'])", {"class": "header-item"})
1212

13+
assert-property: ("div.on-this-page", {"innerHTML": '<ol class="section"><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-1" class="header-in-summary current-header">Heading 1</a></span><ol class="section"><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-11" class="header-in-summary">Heading 1.1</a></span></li><li class="header-item"><span class="chapter-link-wrapper"><a href="#heading-12" class="header-in-summary">Heading 1.2</a><a class="chapter-fold-toggle header-toggle"><div>❱</div></a></span><ol class="section"><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-121" class="header-in-summary">Heading 1.2.1</a></span></li><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-122" class="header-in-summary">Heading 1.2.2</a></span></li></ol></li></ol></li><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-13" class="header-in-summary">Heading 1.3</a></span></li><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-2" class="header-in-summary">Heading 2</a></span><ol class="section"><li class="header-item"><span class="chapter-link-wrapper"><a href="#heading-21" class="header-in-summary">Heading 2.1</a><a class="chapter-fold-toggle header-toggle"><div>❱</div></a></span><ol class="section"><li class="header-item"><span class="chapter-link-wrapper"><a href="#heading-211" class="header-in-summary">Heading 2.1.1</a><a class="chapter-fold-toggle header-toggle"><div>❱</div></a></span><ol class="section"><li class="header-item"><span class="chapter-link-wrapper"><a href="#heading-2111" class="header-in-summary">Heading 2.1.1.1</a><a class="chapter-fold-toggle header-toggle"><div>❱</div></a></span><ol class="section"><li class="header-item expanded"><span class="chapter-link-wrapper"><a href="#heading-21111" class="header-in-summary">Heading 2.1.1.1.1</a></span></li></ol></li></ol></li></ol></li></ol></li></ol>'})
14+
1315
// Click 1.2, expands it.
1416
click: "a.header-in-summary[href='#heading-12']"
1517
assert-attribute: ("li:has(> span > a[href='#heading-12'])", {"class": "header-item expanded"})

0 commit comments

Comments
 (0)