@@ -225,6 +225,53 @@ context('Delete Plugin List with the Drawer', () => {
225
225
cy . get ( selector . empty ) . should ( 'be.visible' ) ;
226
226
} ) ;
227
227
228
+ it ( 'should disabled global plugin normally' , ( ) => {
229
+ cy . visit ( '/plugin/list' ) ;
230
+ cy . get ( selector . refresh ) . click ( ) ;
231
+ cy . contains ( 'button' , 'Enable' ) . click ( ) ;
232
+ cy . contains ( data . basicAuthPlugin )
233
+ . parents ( selector . pluginCardBordered )
234
+ . within ( ( ) => {
235
+ cy . get ( 'button' ) . click ( {
236
+ force : true ,
237
+ } ) ;
238
+ } ) ;
239
+ cy . get ( selector . drawer )
240
+ . should ( 'be.visible' )
241
+ . within ( ( ) => {
242
+ cy . get ( '#disable' ) . should ( 'have.attr' , 'aria-checked' , 'false' ) ;
243
+ cy . get ( selector . disabledSwitcher ) . click ( ) ;
244
+ cy . get ( selector . checkedSwitcher ) . should ( 'exist' ) ;
245
+ } ) ;
246
+ cy . contains ( 'button' , 'Submit' ) . click ( { force : true } ) ;
247
+ cy . wait ( timeout ) ;
248
+ cy . visit ( '/plugin/list' ) ;
249
+ cy . contains ( data . basicAuthPlugin ) . siblings ( ) . contains ( 'Configure' ) . click ( ) ;
250
+ cy . get ( selector . drawer )
251
+ . should ( 'be.visible' )
252
+ . within ( ( ) => {
253
+ cy . get ( '#disable' ) . should ( 'have.attr' , 'aria-checked' , 'true' ) ;
254
+ cy . get ( selector . disabledSwitcher ) . click ( ) ;
255
+ } ) ;
256
+ cy . contains ( 'button' , 'Submit' ) . click ( { force : true } ) ;
257
+ cy . get ( selector . drawer ) . should ( 'not.exist' ) ;
258
+ cy . contains ( data . basicAuthPlugin ) . should ( 'be.visible' ) ;
259
+ cy . contains ( data . basicAuthPlugin ) . siblings ( ) . contains ( 'Configure' ) . click ( ) ;
260
+ cy . get ( selector . drawer )
261
+ . should ( 'be.visible' )
262
+ . within ( ( ) => {
263
+ cy . get ( '#disable' ) . should ( 'have.attr' , 'aria-checked' , 'false' ) ;
264
+ } ) ;
265
+
266
+ cy . contains ( 'button' , 'Cancel' ) . click ( {
267
+ force : true ,
268
+ } ) ;
269
+ cy . contains ( data . basicAuthPlugin ) . siblings ( ) . contains ( 'Delete' ) . click ( ) ;
270
+ cy . contains ( 'button' , 'Confirm' ) . click ( {
271
+ force : true ,
272
+ } ) ;
273
+ } ) ;
274
+
228
275
it ( 'should be deleted one of the plugins instead of all' , function ( ) {
229
276
cy . visit ( '/plugin/list' ) ;
230
277
cy . get ( selector . refresh ) . click ( ) ;
0 commit comments