Skip to content

Commit

Permalink
fix(settings): users settings cypress
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Mar 7, 2024
1 parent 32f5a15 commit b5b658c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions apps/settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>
</NcAppNavigationNew>

<NcAppNavigationList>
<NcAppNavigationList data-cy-users-settings-navigation-groups="system">
<NcAppNavigationItem id="everyone"
:exact="true"
:name="t('settings', 'Active accounts')"
Expand Down Expand Up @@ -99,7 +99,7 @@
{{ t('settings', 'Create group') }}
</NcActionText>
<NcActionInput :label="t('settings', 'Group name')"
data-cy-settings-new-group-name
data-cy-users-settings-new-group-name
:label-outside="false"
:disabled="loadingAddGroup"
:value.sync="newGroupName"
Expand All @@ -109,7 +109,7 @@
</template>
</NcAppNavigationCaption>

<NcAppNavigationList>
<NcAppNavigationList data-cy-users-settings-navigation-groups="custom">
<GroupListItem v-for="group in groupList"
:id="group.id"
:key="group.id"
Expand Down
20 changes: 10 additions & 10 deletions cypress/e2e/settings/users_groups.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Settings: Create groups', () => {
// open the Create group menu
cy.get('button[aria-label="Create group"]').click()

cy.get('li[data-cy-settings-new-group-name]').within(() => {
cy.get('li[data-cy-users-settings-new-group-name]').within(() => {
// see that the group name is ""
cy.get('input').should('exist').and('have.value', '')
// set the group name to foo
Expand All @@ -54,7 +54,7 @@ describe('Settings: Create groups', () => {
handlePasswordConfirmation(admin.password)

// see that the created group is in the list
cy.get('ul.app-navigation-list').within(() => {
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
// see that the list of groups contains the group foo
cy.contains(groupName).should('exist')
})
Expand All @@ -76,8 +76,8 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => {
})

it('see that the group is in the list', () => {
cy.get('ul.app-navigation-list').contains('li', groupName).should('exist')
cy.get('ul.app-navigation-list').contains('li', groupName).within(() => {
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').contains('li', groupName).should('exist')
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').contains('li', groupName).within(() => {
cy.get('.counter-bubble__counter')
.should('not.exist') // is hidden when 0
})
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => {

it('see the group was successfully assigned', () => {
// see a new memeber
cy.get('ul.app-navigation-list')
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]')
.contains('li', groupName)
.find('.counter-bubble__counter')
.should('contain', '1')
Expand All @@ -142,7 +142,7 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
})

it('see that the group is in the list', () => {
cy.get('ul.app-navigation-list').within(() => {
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
// see that the list of groups contains the group foo
cy.contains(groupName).should('exist').scrollIntoView()
// open the actions menu for the group
Expand All @@ -163,7 +163,7 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
})

it('deleted group is not shown anymore', () => {
cy.get('ul.app-navigation-list').within(() => {
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
// see that the list of groups does not contain the group
cy.contains(groupName).should('not.exist')
})
Expand Down Expand Up @@ -192,12 +192,12 @@ describe('Settings: Delete a non empty group', () => {

it('see that the group is in the list', () => {
// see that the list of groups contains the group
cy.get('ul.app-navigation-list').contains('li', groupName).should('exist').scrollIntoView()
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').contains('li', groupName).should('exist').scrollIntoView()
})

it('can delete the group', () => {
// open the menu
cy.get('ul.app-navigation-list')
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]')
.contains('li', groupName)
.find('button.action-item__menutoggle')
.click({ force: true })
Expand All @@ -212,7 +212,7 @@ describe('Settings: Delete a non empty group', () => {
})

it('deleted group is not shown anymore', () => {
cy.get('ul.app-navigation-list').within(() => {
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
// see that the list of groups does not contain the group foo
cy.contains(groupName).should('not.exist')
})
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-users-3239.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-users-3239.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

0 comments on commit b5b658c

Please sign in to comment.