mediawiki-skins-MinervaNeue/tests/selenium/specs/mainmenu_loggedin.js
jdlrobson c0f08790ea Remove the mw-ui-icon hacks and overrides
Note: this agitates T230232 again - when merging this please
make sure a merge for I929090848f3e04647a97f4979ec78682623fa070
is pending.

In various places we try to override the default mw-ui-icon behaviours
The hacks need to be removed as part of addressing the core problem.

Changes:
* Wherever we use mw-ui-icon-before in PHP - wrap the label with a span
so that label font-size is altered where needed - not the icon
* Where a small icon is needed us isSmall parameter for the Icon component
* Apply font-size to labels of mw-ui-icon-before elements
* The browser tests need a slight update to access the span element inside
a menu item - in the case of the logout button the label is always hidden,
so we need to check the visibility of the parent element (secondary_action)

Bug: T229440
Depends-On:  I3f803ec4c9068b30aa93b803391aa4d65d8310ff
Change-Id: I07e4ae233979636b739f1117dd7703571e0a9366
2019-09-10 10:53:20 -07:00

37 lines
1.1 KiB
JavaScript

const {
iAmLoggedIntoTheMobileWebsite,
iAmOnPage
} = require( '../features/step_definitions/common_steps' ),
{ iSeeALinkToAboutPage, iShouldSeeAUserPageLinkInMenu,
iShouldSeeLogoutLinkInMenu,
iClickOnTheMainNavigationButton,
iShouldSeeALinkInMenu, iShouldSeeALinkToDisclaimer
} = require( '../features/step_definitions/menu_steps' );
// @chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @vagrant @login
describe( 'Menus open correct page for anonymous users', () => {
beforeEach( () => {
iAmLoggedIntoTheMobileWebsite();
iAmOnPage( 'Main Page' );
} );
it( 'Check links in menu', () => {
iClickOnTheMainNavigationButton();
iShouldSeeALinkToDisclaimer();
iShouldSeeAUserPageLinkInMenu();
iSeeALinkToAboutPage();
[ 'Home', 'Random', 'Settings', 'Contributions',
'Watchlist' ].forEach( ( label ) => {
iShouldSeeALinkInMenu( label );
} );
iShouldSeeLogoutLinkInMenu();
try {
iShouldSeeALinkInMenu( 'Nearby' );
} catch ( e ) {
// eslint-disable-next-line no-console
console.warn( 'Nearby item will only appear in main menu if $wgMFNearby is configured' );
}
} );
} );