mediawiki-skins-Vector/tests/jest/skins.vector.js/__snapshots__/dropdownMenus.test.js.snap
Jan Drewniak e4af2b5df3 Prevent addPortletLinkHandler from looping over links twice
- Prevents the addPortletLinkHandler function from looping
over the same links multiple times by indexing
the HTMLElement instead of just the ID, which is an
optional parameter.
- Conditionally adds the icon class if the ID parameter
exists.
- Refactors the function to calculate the width of the
vector toolbar.
- Adds Jest tests to account for the dual icon scenario
and updates existing Jest tests.

Bug: T327369
Change-Id: I2a0934405efebd0e95919bc523d711866236a7e6
2023-02-16 20:05:54 +00:00

28 lines
677 B
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`addPortletLinkHandler Adds a span with icon class to dropdown menus 1`] = `
"
<ul class=\\"vector-menu vector-menu-dropdown\\">
<li class=\\"mw-list-item mw-list-item-js\\" id=\\"test-id\\">
<a href=\\"#test-href\\">
<span>
test link content
</span>
</a>
</li>
</ul>"
`;
exports[`addPortletLinkHandler Does not add an icon when noicon class is present 1`] = `
"
<ul class=\\"vector-menu vector-menu-dropdown\\">
<li class=\\"mw-list-item mw-list-item-js\\" id=\\"test-id\\">
<a href=\\"#test-href\\">
<span>
test link content
</span>
</a>
</li>
</ul>"
`;