diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2025-02-21 10:54:17 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-02-21 09:55:23 +0000 |
commit | e601503000f17e1a7e3f106c307c0ab1a0e19f25 (patch) | |
tree | c987d4e7a2427b8c80c49aa3005215bf346dfc76 | |
parent | 306fa8da91d7cc31bac44a66dd866ae04fa3a46f (diff) | |
download | nextcloud-server-backport/50930/stable30.tar.gz nextcloud-server-backport/50930/stable30.zip |
fix(cypress): opendetails testsbackport/50930/stable30
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r-- | cypress/e2e/files/router-query.cy.ts | 73 |
1 files changed, 2 insertions, 71 deletions
diff --git a/cypress/e2e/files/router-query.cy.ts b/cypress/e2e/files/router-query.cy.ts index 9c6564c8ecf..200434517f3 100644 --- a/cypress/e2e/files/router-query.cy.ts +++ b/cypress/e2e/files/router-query.cy.ts @@ -33,15 +33,6 @@ function skipIfViewerDisabled(this: Mocha.Context): void { }) } -/** - * Check a file was not downloaded - * @param filename The expected filename - */ -function fileNotDownloaded(filename: string): void { - const downloadsFolder = Cypress.config('downloadsFolder') - cy.readFile(join(downloadsFolder, filename)).should('not.exist') -} - describe('Check router query flags:', function() { let user: User let imageId: number @@ -61,50 +52,6 @@ describe('Check router query flags:', function() { }) }) - describe('"opendetails"', () => { - it('open details for known file type', () => { - cy.visit(`/apps/files/files/${imageId}?opendetails`) - - // see sidebar - sidebarIsOpen('image.jpg') - - // but no viewer - cy.findByRole('dialog', { name: 'image.jpg' }) - .should('not.exist') - - // and no download - fileNotDownloaded('image.jpg') - }) - - it('open details for unknown file type', () => { - cy.visit(`/apps/files/files/${archiveId}?opendetails`) - - // see sidebar - sidebarIsOpen('archive.zst') - - // but no viewer - cy.findByRole('dialog', { name: 'archive.zst' }) - .should('not.exist') - - // and no download - fileNotDownloaded('archive.zst') - }) - - it('open details for folder', () => { - cy.visit(`/apps/files/files/${folderId}?opendetails`) - - // see sidebar - sidebarIsOpen('folder') - - // but no viewer - cy.findByRole('dialog', { name: 'folder' }) - .should('not.exist') - - // and no download - fileNotDownloaded('folder') - }) - }) - describe('"openfile"', function() { /** Check the viewer is open and shows the image */ function viewerShowsImage(): void { @@ -143,16 +90,8 @@ describe('Check router query flags:', function() { it('does not open folders but shows details', () => { cy.visit(`/apps/files/files/${folderId}?openfile`) - // See the URL was replaced - cy.url() - .should('match', /[?&]opendetails(&|=|$)/) - .and('not.match', /openfile/) - // See the sidebar is correctly opened - cy.get('[data-cy-sidebar]') - .should('be.visible') - .findByRole('heading', { name: 'folder' }) - .should('be.visible') + sidebarIsOpen('folder') // see the folder was not changed getRowForFileId(imageId).should('exist') @@ -161,16 +100,8 @@ describe('Check router query flags:', function() { it('does not open unknown file types but shows details', () => { cy.visit(`/apps/files/files/${archiveId}?openfile`) - // See the URL was replaced - cy.url() - .should('match', /[?&]opendetails(&|=|$)/) - .and('not.match', /openfile/) - // See the sidebar is correctly opened - cy.get('[data-cy-sidebar]') - .should('be.visible') - .findByRole('heading', { name: 'archive.zst' }) - .should('be.visible') + sidebarIsOpen('archive.zst') // See no file was downloaded const downloadsFolder = Cypress.config('downloadsFolder') |