|
12 | 12 | <x:param name="toc-placeholder-overwrite-contents" select="0"/>
|
13 | 13 |
|
14 | 14 | <x:scenario label="When *empty* TOC nav element is matched">
|
15 |
| - <x:context select="//h:nav[1]"> |
| 15 | + <x:context select="(//h:nav)[1]"> |
16 | 16 | <body>
|
17 | 17 | <nav data-type="toc"/>
|
18 | 18 | <section id="chapter" data-type="chapter">
|
|
42 | 42 | </x:scenario>
|
43 | 43 |
|
44 | 44 | <x:scenario label="When *nonempty* TOC nav element is matched">
|
45 |
| - <x:context select="//h:nav[1]"> |
| 45 | + <x:context select="(//h:nav)[1]"> |
46 | 46 | <body>
|
47 | 47 | <nav data-type="toc">
|
48 | 48 | <h1>Manual TOC</h1>
|
|
122 | 122 | </x:scenario>
|
123 | 123 |
|
124 | 124 | <x:scenario label="When a TOC is generated with a scope specified">
|
125 |
| - <x:context href="skeleton.html" select="//h:nav[@data-type='toc'][1]"> |
| 125 | + <x:context href="skeleton.html" select="(//h:nav[@data-type='toc'])[1]"> |
126 | 126 | <x:param name="autogenerate-toc" select="1"/>
|
127 | 127 | <x:param name="scope" select="(document('../skeleton.html')//h:section[@data-type='sect1'])[1]"/>
|
128 | 128 | </x:context>
|
|
136 | 136 | </x:scenario>
|
137 | 137 |
|
138 | 138 | <x:scenario label="When a standard book-level section (chapter) is matched in tocgen mode">
|
139 |
| - <x:context href="skeleton.html" select="//h:section[@data-type='chapter'][1]" mode="tocgen"/> |
| 139 | + <x:context href="skeleton.html" select="(//h:section[@data-type='chapter'])[1]" mode="tocgen"/> |
140 | 140 | <x:expect label="An entry 'li' should be generated">
|
141 | 141 | <li data-type="chapter"><a href="...">...</a>...</li>
|
142 | 142 | </x:expect>
|
143 | 143 | </x:scenario>
|
144 | 144 |
|
145 | 145 | <x:scenario label="When a standard book-level section (part) is matched in tocgen mode">
|
146 |
| - <x:context href="skeleton.html" select="//h:section[@data-type='part'][1]" mode="tocgen"/> |
| 146 | + <x:context href="skeleton.html" select="(//h:div[@data-type='part'])[1]" mode="tocgen"/> |
147 | 147 | <x:expect label="An entry 'li' should be generated">
|
148 | 148 | <li data-type="part"><a href="...">...</a>...</li>
|
149 | 149 | </x:expect>
|
150 | 150 | </x:scenario>
|
151 |
| - |
152 |
| - <x:pending> |
153 | 151 |
|
154 |
| - <x:scenario label="When a subsection within the toc.section.depth is matched in tocgen mode"> |
155 |
| - <x:context/> |
156 |
| - <x:expect label="An entry 'li' should be generated"/> |
| 152 | + <x:scenario label="When a subsection within the toc.section.depth is matched in tocgen mode"> |
| 153 | + <x:context href="skeleton.html" select="(//h:section[@data-type='sect1'])[1]" mode="tocgen"> |
| 154 | + <x:param name="toc.section.depth" select="1"/> |
| 155 | + </x:context> |
| 156 | + <x:expect label="An entry 'li' should be generated"> |
| 157 | + <li data-type="sect1"><a href="...">...</a></li> |
| 158 | + </x:expect> |
157 | 159 | </x:scenario>
|
158 | 160 |
|
159 | 161 | <x:scenario label="When a subsection at greater depth than the toc.section.depth is matched in tocgen mode">
|
160 |
| - <x:context/> |
161 |
| - <x:expect label="An entry 'li' *should not* be generated"/> |
| 162 | + <x:context href="skeleton.html" select="(//h:section[@data-type='sect2'])[1]" mode="tocgen"> |
| 163 | + <x:param name="toc.section.depth" select="1"/> |
| 164 | + </x:context> |
| 165 | + <x:expect label="An entry 'li' *should not* be generated" select="()"/> |
162 | 166 | </x:scenario>
|
163 | 167 |
|
164 | 168 | <x:scenario label="When a nonsection is matched in tocgen mode">
|
165 |
| - <x:context/> |
166 |
| - <x:expect label="An entry 'li' *should not* be generated"/> |
| 169 | + <x:context href="skeleton.html" select="(//h:p)[1]" mode="tocgen"/> |
| 170 | + <x:expect label="An entry 'li' *should not* be generated" select="()"/> |
| 171 | + </x:scenario> |
| 172 | + |
| 173 | + <x:scenario label="When toc-title is called for English-language content (default)"> |
| 174 | + <x:call template="toc-title"/> |
| 175 | + <x:expect label="it should return the proper TOC title">Table of Contents</x:expect> |
167 | 176 | </x:scenario>
|
168 | 177 |
|
169 |
| - <x:scenario label="When toc-title is called"> |
170 |
| - <x:call name="toc-title"/> |
171 |
| - <x:expect label="it should return the proper TOC title"/> |
172 |
| - </x:scenario> |
| 178 | + <x:pending> |
| 179 | + <x:scenario label="When toc-title is called for non-English-language content"> |
| 180 | + <!-- For this test, would need to further parameterize get-localization-value so that you could grab a different localization for the test --> |
| 181 | + <x:call template="toc-title"/> |
| 182 | + <x:expect label="it should return the proper TOC title"/> |
| 183 | + </x:scenario> |
173 | 184 | </x:pending>
|
174 | 185 | </x:description>
|
0 commit comments