@@ -61,11 +61,11 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => {
61
61
} )
62
62
63
63
it ( 'see that the group is in the list' , ( ) => {
64
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . contains ( 'li' , groupName ) . should ( 'exist' )
65
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . contains ( 'li' , groupName ) . within ( ( ) => {
66
- cy . get ( '.counter-bubble__counter' )
67
- . should ( 'not.exist' ) // is hidden when 0
68
- } )
64
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
65
+ . should ( 'exist' )
66
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
67
+ . find ( '.counter-bubble__counter' )
68
+ . should ( 'not.exist' ) // is hidden when 0
69
69
} )
70
70
71
71
it ( 'see that the user is in the list' , ( ) => {
@@ -103,8 +103,7 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => {
103
103
104
104
it ( 'see the group was successfully assigned' , ( ) => {
105
105
// see a new memeber
106
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' )
107
- . contains ( 'li' , groupName )
106
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
108
107
. find ( '.counter-bubble__counter' )
109
108
. should ( 'contain' , '1' )
110
109
} )
@@ -129,14 +128,14 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
129
128
} )
130
129
131
130
it ( 'see that the group is in the list' , ( ) => {
132
- cy . get ( 'ul[data-cy-users-settings-navigation- groups="custom"]' ) . within ( ( ) => {
133
- // see that the list of groups contains the group foo
134
- cy . contains ( groupName ) . should ( 'exist' ) . scrollIntoView ( )
135
- // open the actions menu for the group
136
- cy . contains ( 'li' , groupName ) . within ( ( ) => {
137
- cy . get ( 'button.action-item__menutoggle ' ) . click ( { force : true } )
138
- } )
139
- } )
131
+ // see that the list of groups contains the group foo
132
+ cy . get ( 'ul[data-cy-users-settings-navigation- groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
133
+ . should ( 'exist' )
134
+ . scrollIntoView ( )
135
+ // open the actions menu for the group
136
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"] ' ) . find ( 'li' ) . contains ( groupName )
137
+ . find ( 'button.action-item__menutoggle' )
138
+ . click ( { force : true } )
140
139
} )
141
140
142
141
it ( 'can delete the group' , ( ) => {
@@ -150,10 +149,9 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => {
150
149
} )
151
150
152
151
it ( 'deleted group is not shown anymore' , ( ) => {
153
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . within ( ( ) => {
154
- // see that the list of groups does not contain the group
155
- cy . contains ( groupName ) . should ( 'not.exist' )
156
- } )
152
+ // see that the list of groups does not contain the group
153
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
154
+ . should ( 'not.exist' )
157
155
// and also not in database
158
156
cy . runOccCommand ( 'group:list --output=json' ) . then ( ( $response ) => {
159
157
const groups : string [ ] = Object . keys ( JSON . parse ( $response . stdout ) )
@@ -181,13 +179,14 @@ describe('Settings: Delete a non empty group', () => {
181
179
182
180
it ( 'see that the group is in the list' , ( ) => {
183
181
// see that the list of groups contains the group
184
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . contains ( 'li' , groupName ) . should ( 'exist' ) . scrollIntoView ( )
182
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
183
+ . should ( 'exist' )
184
+ . scrollIntoView ( )
185
185
} )
186
186
187
187
it ( 'can delete the group' , ( ) => {
188
188
// open the menu
189
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' )
190
- . contains ( 'li' , groupName )
189
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
191
190
. find ( 'button.action-item__menutoggle' )
192
191
. click ( { force : true } )
193
192
@@ -201,10 +200,9 @@ describe('Settings: Delete a non empty group', () => {
201
200
} )
202
201
203
202
it ( 'deleted group is not shown anymore' , ( ) => {
204
- cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . within ( ( ) => {
205
- // see that the list of groups does not contain the group foo
206
- cy . contains ( groupName ) . should ( 'not.exist' )
207
- } )
203
+ // see that the list of groups does not contain the group foo
204
+ cy . get ( 'ul[data-cy-users-settings-navigation-groups="custom"]' ) . find ( 'li' ) . contains ( groupName )
205
+ . should ( 'not.exist' )
208
206
// and also not in database
209
207
cy . runOccCommand ( 'group:list --output=json' ) . then ( ( $response ) => {
210
208
const groups : string [ ] = Object . keys ( JSON . parse ( $response . stdout ) )
0 commit comments