55
66import { expect , test } from '../../support/fixtures/files-page.ts'
77import { mkdir , uploadContent } from '../../support/utils/dav.ts'
8+ import { getToast } from '../../support/utils/toast.ts'
89
910test . describe ( 'Files' , ( ) => {
1011 test ( 'Login with a user and open the files app' , async ( { filesListPage } ) => {
@@ -21,7 +22,7 @@ test.describe('Files', () => {
2122 await expect ( row ) . toBeVisible ( )
2223 await expect ( row ) . toHaveAttribute ( 'data-cy-files-list-row-name' , 'original.txt' )
2324 await expect ( row ) . toBeActiveRow ( )
24- await expect ( page . getByText ( 'The file could not be found' ) ) . toHaveCount ( 0 )
25+ await expect ( getToast ( page , 'The file could not be found' ) ) . toHaveCount ( 0 )
2526 } )
2627
2728 test ( 'Opens a valid folder shows its content' , async ( { page, user, filesListPage } ) => {
@@ -31,13 +32,13 @@ test.describe('Files', () => {
3132 await filesListPage . waitForList ( )
3233
3334 await expect ( filesListPage . getBreadcrumbs ( ) ) . toContainText ( 'folder' )
34- await expect ( page . getByText ( 'The file could not be found' ) ) . toHaveCount ( 0 )
35+ await expect ( getToast ( page , 'The file could not be found' ) ) . toHaveCount ( 0 )
3536 } )
3637
3738 test ( 'Opens an unknown file show an error' , async ( { page } ) => {
3839 await page . goto ( 'apps/files/files/123456' )
3940
4041 // The error toast is shown once the (failing) PROPFIND resolves
41- await expect ( page . getByText ( 'The file could not be found' ) ) . toBeVisible ( )
42+ await expect ( getToast ( page , 'The file could not be found' ) ) . toBeVisible ( )
4243 } )
4344} )
0 commit comments