|
104 | 104 | not(exists(h:nav//h:h1[contains(., 'Manual TOC')]))"/>
|
105 | 105 | </x:scenario>
|
106 | 106 | </x:scenario>
|
107 |
| - |
108 |
| - <x:pending> |
109 | 107 |
|
110 |
| - <!-- How many combinations of empty/nonempty nav, autogenerate-toc, and toc-placeholder-overwrite-contents do we need to do here? --> |
111 |
| - <x:scenario label="When there are multiple TOC nav elements"> |
112 |
| - <x:context> |
| 108 | + <x:scenario label="When there are multiple empty TOC nav elements"> |
| 109 | + <x:context select="//h:nav"> |
113 | 110 | <body>
|
114 | 111 | <nav data-type="toc"/>
|
115 | 112 | <nav data-type="toc"/>
|
116 | 113 | </body>
|
| 114 | + <section data-type="chapter"> |
| 115 | + <h1>This chapter head should be in TOC</h1> |
| 116 | + <p>Go TOC!</p> |
| 117 | + </section> |
| 118 | + <x:param name="autogenerate-toc" select="1"/> |
117 | 119 | </x:context>
|
118 |
| - <x:expect label="Process them all the same way"/> |
| 120 | + <x:expect label="Process them all the same way" |
| 121 | + test="deep-equal(//h:nav[@data-type='toc'][1]/node(), //h:nav[@data-type='toc'][2]/node())"/> |
119 | 122 | </x:scenario>
|
120 | 123 |
|
121 | 124 | <x:scenario label="When a TOC is generated with a scope specified">
|
122 |
| - <x:context/> |
123 |
| - <x:expect label="Root of TOC list should be the scope root"/> |
| 125 | + <x:context href="skeleton.html" select="//h:nav[@data-type='toc'][1]"> |
| 126 | + <x:param name="autogenerate-toc" select="1"/> |
| 127 | + <x:param name="scope" select="(document('../skeleton.html')//h:section[@data-type='sect1'])[1]"/> |
| 128 | + </x:context> |
| 129 | + <x:expect label="Root of TOC list should be the scope root"> |
| 130 | + <nav data-type="toc" id="..."> |
| 131 | + <ol> |
| 132 | + <li data-type="sect1">...</li> |
| 133 | + </ol> |
| 134 | + </nav> |
| 135 | + </x:expect> |
124 | 136 | </x:scenario>
|
125 | 137 |
|
126 | 138 | <x:scenario label="When a standard book-level section (chapter) is matched in tocgen mode">
|
127 |
| - <x:context/> |
128 |
| - <x:expect label="An entry 'li' should be generated"/> |
| 139 | + <x:context href="skeleton.html" select="//h:section[@data-type='chapter'][1]" mode="tocgen"/> |
| 140 | + <x:expect label="An entry 'li' should be generated"> |
| 141 | + <li data-type="chapter"><a href="...">...</a>...</li> |
| 142 | + </x:expect> |
129 | 143 | </x:scenario>
|
130 | 144 |
|
131 | 145 | <x:scenario label="When a standard book-level section (part) is matched in tocgen mode">
|
132 |
| - <x:context/> |
133 |
| - <x:expect label="An entry 'li' should be generated"/> |
| 146 | + <x:context href="skeleton.html" select="//h:section[@data-type='part'][1]" mode="tocgen"/> |
| 147 | + <x:expect label="An entry 'li' should be generated"> |
| 148 | + <li data-type="part"><a href="...">...</a>...</li> |
| 149 | + </x:expect> |
134 | 150 | </x:scenario>
|
| 151 | + |
| 152 | + <x:pending> |
135 | 153 |
|
136 | 154 | <x:scenario label="When a subsection within the toc.section.depth is matched in tocgen mode">
|
137 | 155 | <x:context/>
|
|
0 commit comments