2022-02-15 22:43:04 +00:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
2022-09-14 03:17:27 +00:00
|
|
|
exports[`Table of contents re-rendering re-renders toc when wikipage.tableOfContents hook is fired with empty sections 1`] = `
|
2022-11-21 20:46:04 +00:00
|
|
|
"<nav id=\\"mw-panel-toc\\" class=\\"sidebar-toc\\" role=\\"navigation\\" aria-label=\\"\\" data-event-name=\\"ui.sidebar-toc\\"></nav>
|
2022-09-14 03:17:27 +00:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`Table of contents re-rendering re-renders toc when wikipage.tableOfContents hook is fired with sections 1`] = `
|
2022-11-21 20:46:04 +00:00
|
|
|
"<nav id=\\"mw-panel-toc\\" class=\\"sidebar-toc\\" role=\\"navigation\\" aria-label=\\"\\" data-event-name=\\"ui.sidebar-toc\\"><nav id=\\"mw-panel-toc\\" class=\\"sidebar-toc\\" role=\\"navigation\\" aria-label=\\"Contents\\" data-event-name=\\"ui.sidebar-toc\\">
|
|
|
|
<div class=\\"vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned\\" data-name=\\"vector-toc\\">
|
|
|
|
<h2 class=\\"vector-pinnable-header-label\\">Contents</h2>
|
|
|
|
<button class=\\"vector-pinnable-header-toggle-button vector-pinnable-header-pin-button\\">move to sidebar</button>
|
|
|
|
<button class=\\"vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button\\">hide</button>
|
|
|
|
</div>
|
2022-09-14 03:17:27 +00:00
|
|
|
<ul class=\\"sidebar-toc-contents\\" id=\\"mw-panel-toc-list\\">
|
|
|
|
<li id=\\"toc-mw-content-text\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1\\">
|
2022-09-26 14:04:41 +00:00
|
|
|
<a href=\\"#\\" class=\\"sidebar-toc-link\\">
|
2022-09-14 03:17:27 +00:00
|
|
|
<div class=\\"sidebar-toc-text\\">Beginning</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li id=\\"toc-foo\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#foo\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">1</span>foo</div>
|
|
|
|
</a>
|
|
|
|
<ul id=\\"toc-foo-sublist\\" class=\\"sidebar-toc-list\\">
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li id=\\"toc-bar\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#bar\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2</span>bar</div>
|
|
|
|
</a>
|
|
|
|
<button aria-controls=\\"toc-bar-sublist\\" class=\\"mw-ui-icon mw-ui-icon-wikimedia-expand mw-ui-icon-small sidebar-toc-toggle\\" aria-expanded=\\"true\\">
|
|
|
|
Toggle bar subsection
|
|
|
|
</button>
|
|
|
|
<ul id=\\"toc-bar-sublist\\" class=\\"sidebar-toc-list\\">
|
|
|
|
<li id=\\"toc-baz\\" class=\\"sidebar-toc-list-item sidebar-toc-level-2\\">
|
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#baz\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2.1</span>baz</div>
|
|
|
|
</a>
|
|
|
|
<ul id=\\"toc-baz-sublist\\" class=\\"sidebar-toc-list\\">
|
|
|
|
<li id=\\"toc-qux\\" class=\\"sidebar-toc-list-item sidebar-toc-level-3\\">
|
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#qux\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2.1.1</span>qux</div>
|
|
|
|
</a>
|
|
|
|
<ul id=\\"toc-qux-sublist\\" class=\\"sidebar-toc-list\\">
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li id=\\"toc-quux\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#quux\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">3</span>quux</div>
|
|
|
|
</a>
|
|
|
|
<ul id=\\"toc-quux-sublist\\" class=\\"sidebar-toc-list\\">
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li id=\\"toc-bat\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#bat\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">4</span>bat</div>
|
|
|
|
</a>
|
|
|
|
<ul id=\\"toc-bat-sublist\\" class=\\"sidebar-toc-list\\">
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</nav>
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2022-03-29 20:51:45 +00:00
|
|
|
exports[`Table of contents renders when \`vector-is-collapse-sections-enabled\` is false 1`] = `
|
2022-11-21 20:46:04 +00:00
|
|
|
"<nav id=\\"mw-panel-toc\\" class=\\"sidebar-toc\\" role=\\"navigation\\" aria-label=\\"\\" data-event-name=\\"ui.sidebar-toc\\">
|
|
|
|
<div class=\\"vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned\\" data-name=\\"vector-toc\\">
|
|
|
|
<h2 class=\\"vector-pinnable-header-label\\">Contents</h2>
|
|
|
|
<button class=\\"vector-pinnable-header-toggle-button vector-pinnable-header-pin-button\\">move to sidebar</button>
|
|
|
|
<button class=\\"vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button\\">hide</button>
|
|
|
|
</div>
|
2022-08-15 16:34:28 +00:00
|
|
|
<ul class=\\"sidebar-toc-contents\\" id=\\"mw-panel-toc-list\\">
|
2022-03-15 16:34:59 +00:00
|
|
|
<li id=\\"toc-mw-content-text\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1\\">
|
2022-09-26 14:04:41 +00:00
|
|
|
<a href=\\"#\\" class=\\"sidebar-toc-link\\">
|
2022-03-15 16:34:59 +00:00
|
|
|
<div class=\\"sidebar-toc-text\\">Beginning</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-foo\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
2022-02-18 00:19:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#foo\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">1</span>foo</div>
|
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-foo-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
2022-02-18 00:19:50 +00:00
|
|
|
</li>
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-bar\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
2022-02-18 00:19:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#bar\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2</span>bar</div>
|
|
|
|
</a>
|
2022-04-11 20:56:42 +00:00
|
|
|
<button aria-controls=\\"toc-bar-sublist\\" class=\\"mw-ui-icon mw-ui-icon-wikimedia-expand mw-ui-icon-small sidebar-toc-toggle\\" aria-expanded=\\"true\\">
|
2022-03-29 20:51:45 +00:00
|
|
|
Toggle bar subsection
|
|
|
|
</button>
|
|
|
|
<ul id=\\"toc-bar-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-baz\\" class=\\"sidebar-toc-list-item sidebar-toc-level-2\\">
|
2022-02-18 00:19:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#baz\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2.1</span>baz</div>
|
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-baz-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-qux\\" class=\\"sidebar-toc-list-item sidebar-toc-level-3\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#qux\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2.1.1</span>qux</div>
|
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-qux-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-02-18 00:19:50 +00:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
2022-02-18 00:19:50 +00:00
|
|
|
</li>
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-quux\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#quux\\">
|
2022-02-18 00:19:50 +00:00
|
|
|
<div class=\\"sidebar-toc-text\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
<span class=\\"sidebar-toc-numb\\">3</span>quux</div>
|
2022-02-18 00:19:50 +00:00
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-quux-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
2022-02-18 00:19:50 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2022-03-29 20:51:45 +00:00
|
|
|
exports[`Table of contents renders when \`vector-is-collapse-sections-enabled\` is true 1`] = `
|
2022-11-21 20:46:04 +00:00
|
|
|
"<nav id=\\"mw-panel-toc\\" class=\\"sidebar-toc\\" role=\\"navigation\\" aria-label=\\"\\" data-event-name=\\"ui.sidebar-toc\\">
|
|
|
|
<div class=\\"vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned\\" data-name=\\"vector-toc\\">
|
|
|
|
<h2 class=\\"vector-pinnable-header-label\\">Contents</h2>
|
|
|
|
<button class=\\"vector-pinnable-header-toggle-button vector-pinnable-header-pin-button\\">move to sidebar</button>
|
|
|
|
<button class=\\"vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button\\">hide</button>
|
|
|
|
</div>
|
2022-08-15 16:34:28 +00:00
|
|
|
<ul class=\\"sidebar-toc-contents\\" id=\\"mw-panel-toc-list\\">
|
2022-03-15 16:34:59 +00:00
|
|
|
<li id=\\"toc-mw-content-text\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1\\">
|
2022-09-26 14:04:41 +00:00
|
|
|
<a href=\\"#\\" class=\\"sidebar-toc-link\\">
|
2022-03-15 16:34:59 +00:00
|
|
|
<div class=\\"sidebar-toc-text\\">Beginning</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-foo\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1\\">
|
2022-02-15 22:43:04 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#foo\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">1</span>foo</div>
|
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-foo-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
2022-02-15 22:43:04 +00:00
|
|
|
</li>
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-bar\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1\\">
|
2022-02-15 22:43:04 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#bar\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2</span>bar</div>
|
|
|
|
</a>
|
2022-04-11 20:56:42 +00:00
|
|
|
<button aria-controls=\\"toc-bar-sublist\\" class=\\"mw-ui-icon mw-ui-icon-wikimedia-expand mw-ui-icon-small sidebar-toc-toggle\\" aria-expanded=\\"false\\">
|
2022-03-29 20:51:45 +00:00
|
|
|
Toggle bar subsection
|
|
|
|
</button>
|
|
|
|
<ul id=\\"toc-bar-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-baz\\" class=\\"sidebar-toc-list-item sidebar-toc-level-2\\">
|
2022-02-15 22:43:04 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#baz\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2.1</span>baz</div>
|
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-baz-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-qux\\" class=\\"sidebar-toc-list-item sidebar-toc-level-3\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#qux\\">
|
|
|
|
<div class=\\"sidebar-toc-text\\">
|
|
|
|
<span class=\\"sidebar-toc-numb\\">2.1.1</span>qux</div>
|
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-qux-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-02-15 22:43:04 +00:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
2022-02-15 22:43:04 +00:00
|
|
|
</li>
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-04-05 20:38:00 +00:00
|
|
|
<li id=\\"toc-quux\\" class=\\"sidebar-toc-list-item sidebar-toc-level-1\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
<a class=\\"sidebar-toc-link\\" href=\\"#quux\\">
|
2022-02-15 22:43:04 +00:00
|
|
|
<div class=\\"sidebar-toc-text\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
<span class=\\"sidebar-toc-numb\\">3</span>quux</div>
|
2022-02-15 22:43:04 +00:00
|
|
|
</a>
|
2022-03-29 20:51:45 +00:00
|
|
|
<ul id=\\"toc-quux-sublist\\" class=\\"sidebar-toc-list\\">
|
2022-02-14 18:55:50 +00:00
|
|
|
</ul>
|
2022-02-15 22:43:04 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
"
|
|
|
|
`;
|