Skip to content

Commit 44e3ada

Browse files
author
Sanders Kleinfeld
committed
First set of passing tocgen tests.
1 parent 42e213e commit 44e3ada

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

htmlbook-xsl/xspec/tocgen.xspec

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,36 @@
88
xmlns:e="http://github.com/oreillymedia/epubrenderer"
99
stylesheet="../htmlbook.xsl">
1010

11-
<x:pending>
1211
<x:scenario label="When *empty* TOC nav element is matched">
13-
<x:context>
12+
<x:context select="//h:nav[1]">
1413
<body>
1514
<nav data-type="toc"/>
16-
<section data-type="chapter">
15+
<section id="chapter" data-type="chapter">
1716
<h1>This chapter head should be in TOC</h1>
1817
<p>Go TOC!</p>
1918
</section>
2019
</body>
21-
<x:param name=""/>
2220
</x:context>
2321

2422
<x:scenario label="And autogenerate-toc param is *enabled*">
25-
<x:context/>
26-
<x:expect label="TOC content should be generated"/>
23+
<x:context>
24+
<x:param name="autogenerate-toc" select="1"/>
25+
</x:context>
26+
<x:expect label="TOC content should be generated"
27+
test="count(h:nav[.//h:li[contains(., 'This chapter head should be in TOC')]]) = 1"/>
2728
</x:scenario>
2829

2930
<x:scenario label="And autogenerate-toc param is *disabled*">
30-
<x:context/>
31-
<x:expect label="TOC content *should not* be generated (nav should stay empty"/>
31+
<x:context>
32+
<x:param name="autogenerate-toc" select="0"/>
33+
</x:context>
34+
<x:expect label="TOC content *should not* be generated (nav should stay empty)">
35+
<nav data-type="toc" id="..."/>
36+
</x:expect>
3237
</x:scenario>
3338
</x:scenario>
39+
40+
<x:pending>
3441

3542
<x:scenario label="When *nonempty* TOC nav element is matched">
3643
<x:context>

0 commit comments

Comments
 (0)