11/**
2- * @copyright Copyright (c) 2024 Ferdinand Thiessen <[email protected] > 3- *
4- * @author Ferdinand Thiessen <[email protected] > 5- *
6- * @license AGPL-3.0-or-later
7- *
8- * This program is free software: you can redistribute it and/or modify
9- * it under the terms of the GNU Affero General Public License as
10- * published by the Free Software Foundation, either version 3 of the
11- * License, or (at your option) any later version.
12- *
13- * This program is distributed in the hope that it will be useful,
14- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16- * GNU Affero General Public License for more details.
17- *
18- * You should have received a copy of the GNU Affero General Public License
19- * along with this program. If not, see <http://www.gnu.org/licenses/>.
20- *
2+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
3+ * SPDX-License-Identifier: AGPL-3.0-or-later
214 */
225
236import type { User } from '@nextcloud/cypress'
@@ -44,7 +27,10 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
4427
4528 triggerActionForFile ( 'file' , 'details' )
4629
47- cy . get ( '[cy-data-sidebar]' ) . should ( 'be.visible' )
30+ cy . get ( '[data-cy-sidebar]' )
31+ . should ( 'be.visible' )
32+ . findByRole ( 'heading' , { name : 'file' } )
33+ . should ( 'be.visible' )
4834 } )
4935
5036 it ( 'changes the current fileid' , ( ) => {
@@ -53,7 +39,7 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
5339
5440 triggerActionForFile ( 'file' , 'details' )
5541
56- cy . get ( '[cy- data-sidebar]' ) . should ( 'be.visible' )
42+ cy . get ( '[data-cy -sidebar]' ) . should ( 'be.visible' )
5743 cy . url ( ) . should ( 'contain' , `apps/files/files/${ fileId } ` )
5844 } )
5945
@@ -84,7 +70,8 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
8470 // open the sidebar
8571 triggerActionForFile ( 'file' , 'details' )
8672 // validate it is open
87- cy . get ( '[cy-data-sidebar]' ) . should ( 'be.visible' )
73+ cy . get ( '[data-cy-sidebar]' )
74+ . should ( 'be.visible' )
8875
8976 // if we navigate to the folder
9077 navigateToFolder ( 'folder' )
@@ -104,7 +91,10 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
10491 cy . get ( '[data-cy-sidebar]' ) . should ( 'be.visible' )
10592 // delete the file
10693 triggerActionForFile ( 'file' , 'delete' )
107- cy . get ( '[cy-data-sidebar]' ) . should ( 'not.exist' )
94+ cy . wait ( '@deleteFile' , { timeout : 10000 } )
95+ // see the sidebar is closed
96+ cy . get ( '[data-cy-sidebar]' )
97+ . should ( assertNotExistOrNotVisible )
10898 } )
10999
110100 it ( 'changes the fileid on delete' , ( ) => {
@@ -122,11 +112,13 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
122112 // open the sidebar
123113 triggerActionForFile ( 'other' , 'details' )
124114 // validate it is open
125- cy . get ( '[cy- data-sidebar]' ) . should ( 'be.visible' )
115+ cy . get ( '[data-cy -sidebar]' ) . should ( 'be.visible' )
126116 cy . url ( ) . should ( 'contain' , `apps/files/files/${ otherFileId } ` )
127117
128118 triggerActionForFile ( 'other' , 'delete' )
129- cy . get ( '[cy-data-sidebar]' ) . should ( 'not.exist' )
119+ cy . wait ( '@deleteFile' )
120+
121+ cy . get ( '[data-cy-sidebar]' ) . should ( 'not.exist' )
130122 // Ensure the URL is changed
131123 cy . url ( ) . should ( 'not.contain' , `apps/files/files/${ otherFileId } ` )
132124 } )
0 commit comments