This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
message_draft_spec.js
49 lines (38 loc) · 1.95 KB
/
message_draft_spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// ***************************************************************
// - [#] indicates a test step (e.g. 1. Go to a page)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************
/*eslint max-nested-callbacks: ["error", 4]*/
let testTeam;
describe('Message Draft', () => {
before(() => {
// # Login as new user
cy.loginAsNewUser().then(() => {
// # Create new team and visit its URL
cy.apiCreateTeam('test-team', 'Test Team').then((response) => {
testTeam = response.body;
cy.visit(`/${testTeam.name}`);
});
});
});
it('M13473 Message Draft - Pencil Icon', () => {
// # Got to a test channel on the side bar
cy.get('#sidebarItem_town-square').click({force: true});
// * Validate if the channel has been opened
cy.url().should('include', `/${testTeam.name}/channels/town-square`);
// * Validate if the draft icon is not visible on the sidebar before making a draft
cy.get('#publicChannel').scrollIntoView();
cy.get('#sidebarItem_town-square #draftIcon').should('be.not.visible');
// # Type in some text into the text area of the opened channel
cy.get('#post_textbox').type('comm');
// # Go to another test channel without submitting the draft in the previous channel
cy.get('#sidebarItem_off-topic').click({force: true});
// * Validate if the newly navigated channel is open
cy.url().should('include', `/${testTeam.name}/channels/off-topic`);
// * Validate if the draft icon is visible on side bar on the previous channel with a draft
cy.get('#sidebarItem_town-square #draftIcon').should('be.visible');
});
});