mediawiki-skins-Vector/tests/jest
Nicholas Ray 17433b63fc Add hash fragment support to table of contents
Per T325086, the TOC should expand and activate the section that corresponds to
the window's hash fragment.

Additional changes:

* Moves logic  that runs on page load to determine the
intersection from section observer to main.js, since the hash fragment can
take precedence over the scroll position (e.g. when scrolled all the way to the
bottom).

* Make section observer's pause() cancel any pending intersection calculations
so that it doesn't interfere with other async logic.

* Moves onHeadingClick and onToggleClick logic to activate and expand a section
to tableOfContents.js to facilitate unit testing this behavior with clicks and
hash fragment changes.

Bug: T325086
Change-Id: I8a2cf0e6a96467fae97608450b321c181155e424
2023-03-09 00:33:37 -07:00
..
__mocks__ Limited width toggle 2022-11-01 16:29:43 +00:00
__snapshots__ Table of contents: FIXME cleanup 2023-02-24 01:16:20 +00:00
skins.vector.es6 Add hash fragment support to table of contents 2023-03-09 00:33:37 -07:00
skins.vector.js Prevent addPortletLinkHandler from looping over links twice 2023-02-16 20:05:54 +00:00
AB.test.js Add tests for dropdownMenu.js 2022-09-01 13:11:22 -07:00
App.test.js Search: Use Codex and Vue 3 instead of WVUI and Vue 2. 2022-07-18 12:54:47 -07:00
deferUntilFrame.test.js Fix TOC section activation on link click bug 2022-02-08 14:45:16 -07:00
fetch.test.js Add fetch tests from WVUI 2022-02-15 14:00:40 -06:00
instrumentation.test.js search: Remove unused generateUrl() function 2022-12-06 13:35:45 +01:00
pinnableElement.test.js Add setFocusToToggleButton function to pinnableElement.js 2023-02-01 14:31:53 -06:00
restSearchClient.test.js search: Don’t pass searchApiUrl into fetchByTitle() 2022-11-25 15:00:16 +01:00
stickyHeader.test.js Only render TOC related HTML when TOC is available 2023-02-27 16:31:03 -06:00
tableOfContents.test.js Add hash fragment support to table of contents 2023-03-09 00:33:37 -07:00
urlGenerator.test.js search: Remove unused generateUrl() function 2022-12-06 13:35:45 +01:00
userLinks.test.js Add snapshot class to sticky header tests 2022-05-12 10:51:43 -05:00
userLinksData.js Rename IconLink to Link 2023-02-22 22:00:24 +00:00