Skip to content

Commit

Permalink
Cypress/E2E: Stabilize emoji specs (mattermost#6657)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Baylon authored Oct 6, 2020
1 parent 486e807 commit 9248a75
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
11 changes: 4 additions & 7 deletions e2e/cypress/integration/emoji/recently_used_emoji_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,19 @@ describe('Recent Emoji', () => {

// # Click first emoji
cy.get('#emojiPicker').should('be.visible');
cy.get('.emoji-picker__item').eq(firstEmoji).click();
cy.get('.emoji-picker__item').eq(firstEmoji).click().wait(TIMEOUTS.HALF_SEC);

// # Submit post
cy.get('#create_post').submit();

// # Wait 500 millisecond
cy.wait(TIMEOUTS.HALF_SEC);
cy.get('#create_post').submit().wait(TIMEOUTS.HALF_SEC);

// # Post reaction to post
cy.clickPostReactionIcon();

// # Click second emoji
cy.get('.emoji-picker__item').eq(secondEmoji).click();
cy.get('.emoji-picker__item').eq(secondEmoji).click().wait(TIMEOUTS.HALF_SEC);

// # Show emoji list
cy.get('#emojiPickerButton').click();
cy.get('#emojiPickerButton').click().wait(TIMEOUTS.HALF_SEC);

// * Assert first emoji should equal with second recent emoji
cy.get('.emoji-picker__item').eq(firstEmoji + 2).find('img').then(($el) => {
Expand Down
57 changes: 30 additions & 27 deletions e2e/cypress/integration/messaging/emoji_to_markdown_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,41 @@
// Stage: @prod
// Group: @messaging

import * as TIMEOUTS from '../../fixtures/timeouts';

describe('Messaging', () => {
before(() => {
// # Login as test user and visit town-square
cy.apiInitSetup({loginAfter: true}).then(({team}) => {
cy.visit(`/${team.name}/channels/town-square`);
});
});

it('MM-T198 Emojis preceeded by 4 or more spaces are always treated as markdown', () => {
[
' :taco:',
' :taco:',
' :D',
' :D',
].forEach((message) => {
createAndVerifyMessage(message, true);
});

[
' :taco:',
' :D',
].forEach((message) => {
createAndVerifyMessage(message, false);
});
});
});

function createMessages(message, aliases) {
cy.postMessage(message);
cy.getLastPostId().then((postId) => {
cy.get(`#postMessageText_${postId}`).as(aliases[0]);
cy.clickPostCommentIcon(postId);
cy.wait(TIMEOUTS.HALF_SEC);
});

cy.postMessageReplyInRHS(message);
Expand Down Expand Up @@ -43,30 +73,3 @@ function createAndVerifyMessage(message, isCode) {
});
}
}

describe('Messaging', () => {
before(() => {
// # Login as test user and visit town-square
cy.apiInitSetup({loginAfter: true}).then(({team}) => {
cy.visit(`/${team.name}/channels/town-square`);
});
});

it('MM-T198 Emojis preceeded by 4 or more spaces are always treated as markdown', () => {
[
' :taco:',
' :taco:',
' :D',
' :D',
].forEach((message) => {
createAndVerifyMessage(message, true);
});

[
' :taco:',
' :D',
].forEach((message) => {
createAndVerifyMessage(message, false);
});
});
});

0 comments on commit 9248a75

Please sign in to comment.