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

Cypress/E2E: Apply temp fix to dnd e2e #8158

Merged
merged 3 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
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 @@ -178,7 +178,7 @@ describe('Verify Accessibility Support in Dropdown Menus', () => {
{id: 'status-menu-custom-status', label: 'Custom Status dialog'},
{id: 'status-menu-online', label: 'online'},
{id: 'status-menu-away', label: 'away'},
{id: 'status-menu-dnd_menuitem', label: 'do not disturb. disables all notifications'},
{id: 'status-menu-dnd', label: 'do not disturb. disables all notifications'},
{id: 'status-menu-offline', label: 'offline'},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('Custom Theme - Sidebar Styles', () => {
cy.get('.away--icon').should('have.css', 'fill', rgbArrayToString(themeRgbColor.awayIndicator));

// # Set user status to do not disturb
cy.uiOpenDndStatusSubMenu().find('#dndTime-30mins_menuitem').click();
cy.uiOpenSetStatusMenu('Do Not Disturb');

// * Check Do Not Disturb Indicator color
cy.get('.dnd--icon').should('have.css', 'fill', rgbArrayToString(themeRgbColor.dndIndicator));
Expand Down
8 changes: 2 additions & 6 deletions e2e/cypress/integration/menus/status_dropdown_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Status dropdown menu', () => {
const statusTestCases = [
{id: 'status-menu-online', icon: 'online--icon', text: 'Online'},
{id: 'status-menu-away', icon: 'away--icon', text: 'Away'},
{id: 'status-menu-dnd_menuitem', icon: 'dnd--icon', text: 'Do Not Disturb'},
{id: 'status-menu-dnd', icon: 'dnd--icon', text: 'Do Not Disturb'},
{id: 'status-menu-offline', text: 'Offline'},
];

Expand Down Expand Up @@ -100,11 +100,7 @@ function stepThroughStatuses(statusTestCases = []) {
// * Verify the user's status icon changes correctly every time
statusTestCases.forEach((tc) => {
// # Open status menu and click option
if (tc.text === 'Do Not Disturb') {
cy.uiOpenDndStatusSubMenu().find('#dndTime-30mins_menuitem').click();
} else {
cy.uiOpenSetStatusMenu(tc.text);
}
cy.uiOpenSetStatusMenu(tc.text);

// # Verify correct status icon is shown on user's profile picture
cy.get('.MenuWrapper.status-dropdown-menu svg').should('have.attr', 'aria-label', `${tc.text} Icon`);
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/support/ui/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Cypress.Commands.add('uiOpenDndStatusSubMenu', () => {
cy.get('.MenuWrapper.status-dropdown-menu .Menu__content.dropdown-menu').should('be.visible');

// # Hover over Do Not Disturb option
cy.get('.MenuWrapper.status-dropdown-menu .Menu__content.dropdown-menu li#status-menu-dnd_menuitem').trigger('mouseover');
cy.get('.MenuWrapper.status-dropdown-menu .Menu__content.dropdown-menu li#status-menu-dnd').trigger('mouseover');

return cy.get('#status-menu-dnd');
});