mirror of
https://github.com/hanzoai/team.git
synced 2026-11-01 07:55:31 +00:00
* MM-61173 - channel settings modal: base modal, initial commit, file creation and base component * new enhancements to the base modal creation * revert changes on textbox_links and edit channel header * fix types and add back unintentioned deleted value * add the preview textbox component * extract logic for info tab into its own component * add the purpose input to the window * move other component logic to its own component and code clean up * ability to update channel type * more advances on the archive channel tab * fix unit test in textbox * fix translations * do not show the archive modal in default channel * fix issue with url editor not being resetted on undo action * adjust text and styling for the header and purpose inputs * remove textboxlinks and use button eye icon * adjust test and preview button style * add unit test to channel patch * move logic from parent modal to info tab component * fix border issues and focus back to preview textareas * prevent saving changes when pressing enter when selecting an icon * enhance input component to cover limits validations and enhances tests * set default error message for save changes panel * add props to provide custom value to the buttons * remove channel input errors on reset button click * create new component settings textbox * rename component to advanced textbox and add unit tests * styling of the info tab and add error state to advanced textbox * add logic to prevent tab switch with unsaved changes * adjust url error logic and code clean up * code clean up and enhance comments * add char min length to advanced textbox logic * add the channel settings modal to the new menu * add new test files and fix reset error * remove unused error variables * adjust translations and remove unncesary import * enhance permissions for archive channels and manage channel settings * Adjust permission tree so channel admins can convert from private to public * enhance the test suit around channel conversion type * fix some e2e tests and solve channel input name issue * fix unit test by interacting first with the input element * adjust e2e tests to channel settings modal changes * remove commented tests and implement pr feedback * adjust more pr feedback to the code * more pr feedback enhancements * further enhancements to tab navigation, and adjust more e2e tests * remove unused components and fix e2e tests * revert unnecessary permissions changes * Add name label to textboxes * adjust e2e and unit tests * revert min lenght change value and adjust tests and snapshots * Channel banner settings (#30721) * Added channel banner setting header * Updated section styling * handled animation * handled min and max lengths * cleanup * color change fix * general improvements * Fixed API test * removed unused param className * added e2e tests * test: add channel settings configuration tab test file * Based on the context, here's a concise commit message for this change: feat: Add comprehensive tests for ChannelSettingsConfigurationTab * added some more tests * CI * reverted package-lock.json changes in Playwright * remove extra border from advaced textbox * adjust styling for name label in advance texbox and restart preview state on modal close * sync package.lock in playwright --------- Co-authored-by: Mattermost Build <[email protected]> Co-authored-by: Harshil Sharma <[email protected]> Co-authored-by: Harshil Sharma <[email protected]>
121 lines
4.3 KiB
JavaScript
121 lines
4.3 KiB
JavaScript
// 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)
|
|
// ***************************************************************
|
|
|
|
// Stage: @prod
|
|
// Group: @playbooks
|
|
|
|
describe('channels > run', {testIsolation: true}, () => {
|
|
let testTeam;
|
|
let testUser;
|
|
let testPrivateChannel;
|
|
|
|
before(() => {
|
|
cy.apiInitSetup().then(({team, user}) => {
|
|
testTeam = team;
|
|
testUser = user;
|
|
|
|
// # Login as testUser
|
|
cy.apiLogin(testUser);
|
|
|
|
// # Create a playbook
|
|
cy.apiCreatePlaybook({
|
|
teamId: team.id,
|
|
title: 'Playbook',
|
|
memberIDs: [user.id],
|
|
});
|
|
|
|
// # Create a private channel
|
|
cy.apiCreateChannel(
|
|
testTeam.id,
|
|
'private-channel',
|
|
'Private Channel',
|
|
'P',
|
|
).then(({channel}) => {
|
|
testPrivateChannel = channel;
|
|
});
|
|
});
|
|
});
|
|
|
|
beforeEach(() => {
|
|
// # Login as testUser
|
|
cy.apiLogin(testUser);
|
|
|
|
// # Size the viewport to show plugin icons even when RHS is open
|
|
cy.viewport('macbook-13');
|
|
});
|
|
|
|
describe('via slash command', () => {
|
|
it('while viewing a public channel', () => {
|
|
// # Visit a public channel
|
|
cy.visit(`/${testTeam.name}/channels/off-topic`);
|
|
|
|
// * Verify that playbook run can be started with slash command
|
|
const playbookRunName = 'Public ' + Date.now();
|
|
cy.startPlaybookRunWithSlashCommand('Playbook', playbookRunName);
|
|
cy.verifyPlaybookRunActive(testTeam.id, playbookRunName);
|
|
});
|
|
|
|
it('while viewing a private channel', () => {
|
|
// # Visit a private channel
|
|
cy.visit(`/${testTeam.name}/channels/${testPrivateChannel.name}`);
|
|
|
|
// * Verify that playbook run can be started with slash command
|
|
const playbookRunName = 'Private ' + Date.now();
|
|
cy.startPlaybookRunWithSlashCommand('Playbook', playbookRunName);
|
|
cy.verifyPlaybookRunActive(testTeam.id, playbookRunName);
|
|
});
|
|
});
|
|
|
|
describe('via post menu', () => {
|
|
it('while viewing a public channel', () => {
|
|
// # Visit a public channel
|
|
cy.visit(`/${testTeam.name}/channels/off-topic`);
|
|
|
|
// * Verify that playbook run can be started from post menu
|
|
const playbookRunName = 'Public - ' + Date.now();
|
|
cy.startPlaybookRunFromPostMenu('Playbook', playbookRunName);
|
|
cy.verifyPlaybookRunActive(testTeam.id, playbookRunName);
|
|
});
|
|
|
|
it('while viewing a private channel', () => {
|
|
// # Visit a private channel
|
|
cy.visit(`/${testTeam.name}/channels/${testPrivateChannel.name}`);
|
|
|
|
// * Verify that playbook run can be started from post menu
|
|
const playbookRunName = 'Private - ' + Date.now();
|
|
cy.startPlaybookRunFromPostMenu('Playbook', playbookRunName);
|
|
cy.verifyPlaybookRunActive(testTeam.id, playbookRunName);
|
|
});
|
|
});
|
|
|
|
it('always as channel admin', () => {
|
|
// # Visit a public channel
|
|
cy.visit(`/${testTeam.name}/channels/off-topic`);
|
|
|
|
// # Start a playbook run with a slash command
|
|
const playbookRunName = 'Public ' + Date.now();
|
|
cy.startPlaybookRunWithSlashCommand('Playbook', playbookRunName);
|
|
cy.verifyPlaybookRunActive(testTeam.id, playbookRunName);
|
|
|
|
// # Open channel header dropdown
|
|
cy.get('#channelHeaderDropdownButton').click();
|
|
|
|
// # Click on Channel Settings
|
|
cy.findByText('Channel Settings').should('be.visible').click();
|
|
|
|
// * Verify Channel Settings modal opens
|
|
cy.get('.ChannelSettingsModal').should('be.visible');
|
|
|
|
// * Verify the ability to edit the channel header exists
|
|
cy.get('#channel_settings_header_textbox').should('be.visible').and('not.be.disabled');
|
|
|
|
// # Close the modal
|
|
cy.get('.GenericModal .modal-header button[aria-label="Close"]').click();
|
|
});
|
|
});
|