Skip to content

Commit 4158e2c

Browse files
committed
test(settings): exclude the group caption from group-row selectors
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
1 parent 8bfad15 commit 4158e2c

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

apps/settings/src/components/AppNavigationGroupList.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { mount } from '@vue/test-utils'
77
import { describe, expect, it, vi } from 'vitest'
88
import { ref } from 'vue'
99
import NcAppNavigationCaption from '@nextcloud/vue/components/NcAppNavigationCaption'
10+
import AppNavigationGroupList from './AppNavigationGroupList.vue'
1011

1112
// The component builds a real Vuex store via useStore(); mock it so this stays
1213
// a focused component test that controls its own data.
@@ -38,8 +39,6 @@ vi.mock('@vueuse/core', async (importActual) => ({
3839
useElementVisibility: () => ref(false),
3940
}))
4041

41-
import AppNavigationGroupList from './AppNavigationGroupList.vue'
42-
4342
describe('AppNavigationGroupList', () => {
4443
it('does not expose the group list as a heading (BITV 9.1.3.1a)', () => {
4544
const wrapper = mount(AppNavigationGroupList)

cypress/e2e/settings/users_groups.cy.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
163163
// see that the list of groups does not contain the group
164164
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]')
165165
.find('li')
166+
.not('.app-navigation-caption')
166167
.should('not.exist')
167168
// and also not in database
168169
cy.runOccCommand('group:list --output=json').then(($response) => {
@@ -219,6 +220,7 @@ describe('Settings: Delete a non empty group', () => {
219220
// see that the list of groups does not contain the group foo
220221
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]')
221222
.find('li')
223+
.not('.app-navigation-caption')
222224
.should('not.exist')
223225
// and also not in database
224226
cy.runOccCommand('group:list --output=json').then(($response) => {
@@ -260,16 +262,16 @@ describe('Settings: Sort groups in the UI', () => {
260262

261263
it('See that the groups are sorted by the member count', () => {
262264
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
263-
cy.get('li').eq(0).should('contain', 'B') // 1 member
264-
cy.get('li').eq(1).should('contain', 'A') // 0 members
265+
cy.get('li').not('.app-navigation-caption').eq(0).should('contain', 'B') // 1 member
266+
cy.get('li').not('.app-navigation-caption').eq(1).should('contain', 'A') // 0 members
265267
})
266268
})
267269

268270
it('See that the order is preserved after a reload', () => {
269271
cy.reload()
270272
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
271-
cy.get('li').eq(0).should('contain', 'B') // 1 member
272-
cy.get('li').eq(1).should('contain', 'A') // 0 members
273+
cy.get('li').not('.app-navigation-caption').eq(0).should('contain', 'B') // 1 member
274+
cy.get('li').not('.app-navigation-caption').eq(1).should('contain', 'A') // 0 members
273275
})
274276
})
275277

@@ -288,16 +290,16 @@ describe('Settings: Sort groups in the UI', () => {
288290

289291
it('See that the groups are sorted by the user count', () => {
290292
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
291-
cy.get('li').eq(0).should('contain', 'A')
292-
cy.get('li').eq(1).should('contain', 'B')
293+
cy.get('li').not('.app-navigation-caption').eq(0).should('contain', 'A')
294+
cy.get('li').not('.app-navigation-caption').eq(1).should('contain', 'B')
293295
})
294296
})
295297

296298
it('See that the order is preserved after a reload', () => {
297299
cy.reload()
298300
cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => {
299-
cy.get('li').eq(0).should('contain', 'A')
300-
cy.get('li').eq(1).should('contain', 'B')
301+
cy.get('li').not('.app-navigation-caption').eq(0).should('contain', 'A')
302+
cy.get('li').not('.app-navigation-caption').eq(1).should('contain', 'B')
301303
})
302304
})
303305
})

dist/settings-vue-settings-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)