2021-11-24 13:43:04 +02:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
describe('Manage groups', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.apiInitServer()
|
2021-12-15 18:57:58 +02:00
|
|
|
cy.apiResetBoards()
|
2022-02-28 13:28:16 +02:00
|
|
|
cy.apiGetMe().then((userID) => cy.apiSkipTour(userID))
|
2021-11-24 13:43:04 +02:00
|
|
|
localStorage.setItem('welcomePageViewed', 'true')
|
2022-04-06 16:22:47 +02:00
|
|
|
localStorage.setItem('language', 'en')
|
2021-11-24 13:43:04 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('MM-T4284 Adding a group', () => {
|
2022-01-07 20:58:28 +02:00
|
|
|
// Visit a page and create new empty board
|
2021-11-24 13:43:04 +02:00
|
|
|
cy.visit('/')
|
2022-02-02 10:38:57 +02:00
|
|
|
cy.uiCreateEmptyBoard()
|
2021-11-24 13:43:04 +02:00
|
|
|
|
|
|
|
cy.contains('+ Add a group').click({force: true})
|
2021-11-24 14:24:14 +02:00
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').should('exist')
|
2021-11-24 13:43:04 +02:00
|
|
|
|
2021-11-24 14:24:14 +02:00
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').
|
2021-11-24 13:43:04 +02:00
|
|
|
clear().
|
|
|
|
type('Group 1').
|
|
|
|
blur()
|
2021-11-24 14:24:14 +02:00
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'Group 1\']').should('exist')
|
2021-11-24 13:43:04 +02:00
|
|
|
})
|
2021-12-07 23:33:45 +02:00
|
|
|
|
|
|
|
it('MM-T4285 Adding group color', () => {
|
2022-01-07 20:58:28 +02:00
|
|
|
// Visit a page and create new empty board
|
2021-12-07 23:33:45 +02:00
|
|
|
cy.visit('/')
|
2022-02-02 10:38:57 +02:00
|
|
|
cy.uiCreateEmptyBoard()
|
2021-12-07 23:33:45 +02:00
|
|
|
|
|
|
|
cy.contains('+ Add a group').click({force: true})
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').should('exist')
|
|
|
|
|
|
|
|
cy.get('.KanbanColumnHeader').last().within(() => {
|
|
|
|
cy.get('.icon-dots-horizontal').click({force: true})
|
|
|
|
cy.get('.menu-options').should('exist').within(() => {
|
|
|
|
cy.contains('Hide').should('exist')
|
|
|
|
cy.contains('Delete').should('exist')
|
|
|
|
|
|
|
|
// Some colours
|
|
|
|
cy.contains('Brown').should('exist')
|
|
|
|
cy.contains('Gray').should('exist')
|
|
|
|
cy.contains('Orange').should('exist')
|
|
|
|
|
|
|
|
// Click on green
|
2022-01-07 20:58:28 +02:00
|
|
|
cy.contains('Green').should('be.visible').click().wait(1000) // eslint-disable-line cypress/no-unnecessary-waiting
|
2021-12-07 23:33:45 +02:00
|
|
|
})
|
2022-01-07 20:58:28 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
cy.get('.KanbanColumnHeader').last().within(() => {
|
2021-12-07 23:33:45 +02:00
|
|
|
cy.get('.Label.propColorGreen').should('exist')
|
|
|
|
})
|
|
|
|
})
|
2022-05-27 17:27:11 +02:00
|
|
|
|
|
|
|
it('MM-T4287 Hiding/unhiding a group', () => {
|
|
|
|
// Step 1: Create an empty board and add a group
|
|
|
|
cy.visit('/')
|
|
|
|
cy.uiCreateEmptyBoard()
|
|
|
|
|
|
|
|
cy.contains('+ Add a group').click({force: true})
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').should('exist')
|
|
|
|
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'New group\']').
|
|
|
|
clear().
|
|
|
|
type('Group 1').
|
|
|
|
blur()
|
|
|
|
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'Group 1\']').should('exist')
|
|
|
|
|
|
|
|
// Step 2: Click on the three dots next to "Group 1"
|
|
|
|
cy.get('.KanbanColumnHeader').last().within(() => {
|
|
|
|
cy.get('.icon-dots-horizontal').click({force: true})
|
|
|
|
cy.get('.menu-options').should('exist').within(() => {
|
|
|
|
cy.contains('Hide').should('exist')
|
|
|
|
cy.contains('Delete').should('exist')
|
|
|
|
|
|
|
|
// Some colours
|
|
|
|
cy.contains('Brown').should('exist')
|
|
|
|
cy.contains('Gray').should('exist')
|
|
|
|
cy.contains('Orange').should('exist')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// Step 3: Click on "Hide"
|
|
|
|
cy.contains('Hide').click({force: true})
|
|
|
|
cy.get('.octo-board-hidden-item').contains('Group 1').should('exist')
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'Group 1\']').should('not.exist')
|
|
|
|
|
|
|
|
// Step 4: Click "Group 1", then click "Show" in the dropdown
|
|
|
|
cy.contains('Group 1').click({force: true})
|
|
|
|
cy.contains('Show').click({force: true})
|
|
|
|
cy.get('.octo-board-hidden-item').contains('Group 1').should('not.exist')
|
|
|
|
cy.get('.KanbanColumnHeader .Editable[value=\'Group 1\']').should('exist')
|
|
|
|
})
|
2021-11-24 13:43:04 +02:00
|
|
|
})
|