mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-04 12:09:30 +00:00
e4af2b5df3
- 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
28 lines
677 B
Plaintext
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>"
|
|
`;
|