Этот коммит содержится в:
Mario Vitale
2023-03-27 16:28:42 +02:00
родитель da7a6825ce
Коммит ba6b97fb62
1142 изменённых файлов: 44 добавлений и 44 удалений

Просмотреть файл

@@ -0,0 +1,40 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// ***************************************************************
// - [#] indicates a test step (e.g. # Go to a page)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************
// Stage: @prod
// Group: @channels @commands
import * as TIMEOUTS from '../../../fixtures/timeouts';
describe('Leave Channel Command', () => {
let testChannel;
before(() => {
// # Login as test user and go to town-square
cy.apiInitSetup({loginAfter: true}).then(({team, channel}) => {
testChannel = channel;
cy.visit(`/${team.name}/channels/town-square`);
cy.get('#channelHeaderTitle').should('be.visible').and('contain', 'Town Square');
});
});
it('Should be redirected to last channel when user leaves channel with /leave command', () => {
// # Go to newly created channel
cy.get('#sidebarItem_' + testChannel.name).click({force: true});
cy.findAllByTestId('postView').should('be.visible');
// # Post /leave command in center channel
cy.postMessage('/leave ');
cy.wait(TIMEOUTS.TWO_SEC); // eslint-disable-line cypress/no-unnecessary-waiting
// * Assert that user is redirected to townsquare
cy.url().should('include', '/channels/town-square');
cy.get('#channelHeaderTitle').should('be.visible').and('contain', 'Town Square');
});
});