Skip to content

Commit

Permalink
test: add tests for enable analytics toggles
Browse files Browse the repository at this point in the history
  • Loading branch information
rayacers committed Mar 9, 2023
1 parent e0ff7da commit b3983cf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cypress/e2e/item/settings/itemSettings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
SETTINGS_LINK_SHOW_BUTTON_ID,
SETTINGS_LINK_SHOW_IFRAME_ID,
SETTINGS_PINNED_TOGGLE_ID,
SETTINGS_SAVE_ACTIONS_TOGGLE_ID,
} from '../../../../src/config/selectors';
import {
ITEM_WITH_CHATBOX_MESSAGES,
Expand Down Expand Up @@ -206,6 +207,19 @@ describe('Item Settings', () => {
});
});

describe('Analytics Settings', () => {
it('Layout', () => {
const itemId = ITEMS_SETTINGS.items[2].id;
cy.visit(buildItemPath(itemId));
cy.get(`.${ITEM_SETTINGS_BUTTON_CLASS}`).click();

cy.get(`#${SETTINGS_SAVE_ACTIONS_TOGGLE_ID}`)
.should('be.exist')
.should('be.disabled')
.should('not.be.checked');
});
});

describe('Link Settings', () => {
it('Does not show link settings for folder item', () => {
const itemId = ITEMS_SETTINGS.items[0].id;
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/memberProfile.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
MEMBER_PROFILE_MEMBER_ID_COPY_BUTTON_ID,
MEMBER_PROFILE_MEMBER_ID_ID,
MEMBER_PROFILE_MEMBER_NAME_ID,
MEMBER_PROFILE_SAVE_ACTIONS_TOGGLE_ID,
USER_CONFIRM_PASSWORD_INPUT_ID,
USER_CURRENT_PASSWORD_INPUT_ID,
USER_NEW_PASSWORD_INPUT_ID,
Expand Down Expand Up @@ -47,6 +48,10 @@ describe('Member Profile', () => {
'contain',
emailFrequency[extra.emailFreq],
);
cy.get(`#${MEMBER_PROFILE_SAVE_ACTIONS_TOGGLE_ID}`)
.should('be.exist')
.should('be.disabled')
.should('not.be.checked');
cy.get(`#${USER_CURRENT_PASSWORD_INPUT_ID}`).should('be.visible');
cy.get(`#${USER_NEW_PASSWORD_INPUT_ID}`).should('be.visible');
cy.get(`#${USER_CONFIRM_PASSWORD_INPUT_ID}`).should('be.visible');
Expand Down
1 change: 1 addition & 0 deletions cypress/fixtures/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ export const ITEMS_SETTINGS = {
settings: {
isPinned: false,
showChatbox: false,
enableSaveActions: false,
},
memberships: [
{
Expand Down
1 change: 1 addition & 0 deletions cypress/fixtures/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const MEMBERS = {
extra: {
lang: 'fr',
emailFreq: 'never',
enableSaveActions: false,
},
},
BOB: {
Expand Down

0 comments on commit b3983cf

Please sign in to comment.