Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-27814] cypress test for T553 #6435

Merged
merged 2 commits into from
Sep 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,50 @@ describe('reply-notifications', () => {
});
});

it('MM-T554 Trigger notifications on messages in reply threads that I start or participate in', () => {
it('MM-T553 Trigger notifications on messages in reply threads that I start or participate in - start thread', () => {
cy.visit(`/${testTeam.name}/channels/town-square`);

// Setup notification spy
spyNotificationAs('notifySpy', 'granted');

// # Set users notification settings
setReplyNotificationsSetting('#notificationCommentsAny');

// # Post a message
cy.postMessage('Hi there, this is another root message');

// # Get post id of message
cy.getLastPostId().then((postId) => {
// # Switch to other channel so that unread notifications in 'town-square` may be triggered
cy.get(`#sidebarItem_${otherChannel.name}`).click({force: true});

// # Post a message in original thread as another user
const message = 'This is a reply to the root post';
cy.postMessageAs({sender, message, channelId: townsquareChannelId, rootId: postId}).then(() => {
// * Verify stub was called
cy.get('@notifySpy').should('be.called');

// * Verify unread mentions badge exists
cy.get('#sidebarItem_town-square').find('#unreadMentions').should('be.visible');

// # Navigate to town square channel
cy.get(`#sidebarItem_${'town-square'}`).click({force: true});

// * Verify entire message
cy.getLastPostId().then((msgId) => {
cy.get(`#postMessageText_${msgId}`).as('postMessageText');

// * Verify reply bar highlight
cy.get(`#${msgId}_message`).should('have.class', 'mention-comment');
});
cy.get('@postMessageText').
should('be.visible').
and('have.text', message);
});
});
});

it('MM-T554 Trigger notifications on messages in reply threads that I start or participate in - participate in', () => {
cy.visit(`/${testTeam.name}/channels/town-square`);

// Setup notification spy
Expand Down