mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 11:13:34 +00:00
2d579183c9
Following up on Jon's POC, this will get rid of the talk board component in favor of linking to the server rendered talk page. Additional Changes: * Cleaned up talk selenium tests. Removed talk_steps.rb which doesn't appear to be used anymore. * Changed talk add button classes to a single class * Moved "Add discussion" button to postheadinghtml per design mock * Added "...talk-explained", "...talk-explained-empty" messages to postheadinghtml per design mock * Due to undesirable jumps in window scroll caused by the section anchor & Toggler.js code when opening the TalkSectionOverlay (read fixme in code), a Promise is always returned from OverlayManager route to reset the scroll position to the top when the section overlay is opened. * Moved "mobile-frontend-talk-fullpage", "mobile-frontend-talk-reply-success", "mobile-frontend-talk-topic-feedback", "mobile-frontend-talk-explained" "mobile-frontend-talk-explained-empty" messages to minerva as minerva is the one who initiates those messages now. * Limited $talk selector to only `.talk` elements since amc talk tab does not need to be targeted * After saving a reply from TalkSectionOverlay, the DOM that is not part of the overlay becomes out of sync since a new reply was created. To get around this, an `onSaveComplete` callback was passed (similar to the TalkSectionAddOverlay) to execute a full page refresh. Although this is clunky, it is the easiest way to resync. Bug: T230695 Depends-On: I80201394fd7015db6700446142b0b4b20829f12e Change-Id: I243f1193bce0da9fa710fc3b5379f90b2d079680
77 lines
2.1 KiB
JavaScript
77 lines
2.1 KiB
JavaScript
const { iAmOnATalkPageWithNoTalkTopics } = require( '../features/step_definitions/create_page_api_steps' ),
|
|
{
|
|
pageExists, iAmOnAPageThatDoesNotExist,
|
|
iAmUsingTheMobileSite,
|
|
iAmLoggedIntoTheMobileWebsite,
|
|
iAmOnPage
|
|
} = require( '../features/step_definitions/common_steps' ),
|
|
{
|
|
iClickTheAddTalkButton,
|
|
iAddATopic,
|
|
iSeeTheTalkOverlay,
|
|
thereShouldBeASaveDiscussionButton,
|
|
noTopicIsPresent,
|
|
thereShouldBeAnAddDiscussionButton,
|
|
thereShouldBeATalkButton,
|
|
thereShouldBeNoTalkButton,
|
|
iShouldSeeTheTopicInTheListOfTopics
|
|
} = require( '../features/step_definitions/talk_steps' );
|
|
|
|
// @chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @vagrant
|
|
describe( 'Talk', () => {
|
|
|
|
before( () => {
|
|
pageExists( 'Talk:Selenium talk test' );
|
|
pageExists( 'Selenium talk test' );
|
|
} );
|
|
|
|
beforeEach( () => {
|
|
iAmUsingTheMobileSite();
|
|
} );
|
|
|
|
it( 'Talk button not visible as logged out user', () => {
|
|
iAmOnPage( 'Selenium talk test' );
|
|
thereShouldBeNoTalkButton();
|
|
} );
|
|
|
|
// @login
|
|
it( 'Talk button visible as logged in user', () => {
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
iAmOnPage( 'Selenium talk test' );
|
|
thereShouldBeATalkButton();
|
|
} );
|
|
|
|
// @login
|
|
it( 'Talk on a page that doesn\'t exist (bug 64268)', () => {
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
iAmOnAPageThatDoesNotExist();
|
|
thereShouldBeATalkButton();
|
|
} );
|
|
|
|
// @smoke @login
|
|
it( 'Add discussion button shows on talk pages for logged in users', () => {
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
iAmOnPage( 'Talk:Selenium talk test' );
|
|
thereShouldBeAnAddDiscussionButton();
|
|
} );
|
|
|
|
// @smoke @login
|
|
it( 'Add discussion for talk page possible as logged in user', () => {
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
iAmOnPage( 'Talk:Selenium talk test' );
|
|
iClickTheAddTalkButton();
|
|
thereShouldBeASaveDiscussionButton();
|
|
} );
|
|
|
|
it( 'A newly created topic appears in the list of topics', () => {
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
iAmOnATalkPageWithNoTalkTopics();
|
|
noTopicIsPresent();
|
|
iClickTheAddTalkButton();
|
|
iSeeTheTalkOverlay();
|
|
iAddATopic( 'New topic' );
|
|
iShouldSeeTheTopicInTheListOfTopics( 'New topic' );
|
|
} );
|
|
|
|
} );
|