diff --git a/cypress/e2e/non-dav-files.cy.js b/cypress/e2e/non-dav-files.cy.js index b13be09e2..bf74cab8e 100644 --- a/cypress/e2e/non-dav-files.cy.js +++ b/cypress/e2e/non-dav-files.cy.js @@ -40,7 +40,7 @@ describe('Open non-dav files in viewer', function() { it('Open login background', function() { const fileInfo = { filename: '/core/img/logo/logo.png', - basename: '/core/img/logo', + basename: 'logo.png', mime: 'image/png', source: '/core/img/logo/logo.png', etag: 'abc', @@ -54,7 +54,23 @@ describe('Open non-dav files in viewer', function() { list: [fileInfo], }) }) + }) + + it('Does not see a loading animation', function() { + cy.get('body > .viewer', { timeout: 10000 }) + .should('be.visible') + .and('have.class', 'modal-mask') + .and('not.have.class', 'icon-loading') + }) + it('See the menu icon and title on the viewer header', function() { + cy.get('body > .viewer .modal-title').should('contain', 'image.png') + cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible') cy.get('body > .viewer .modal-header button.header-close').should('be.visible') }) + + it('Does not see navigation arrows', function() { + cy.get('body > .viewer a.prev').should('not.be.visible') + cy.get('body > .viewer a.next').should('not.be.visible') + }) }) diff --git a/cypress/e2e/visual-regression.cy.js b/cypress/e2e/visual-regression.cy.js index 7d22dce97..10892e7b8 100644 --- a/cypress/e2e/visual-regression.cy.js +++ b/cypress/e2e/visual-regression.cy.js @@ -89,7 +89,7 @@ describe('Visual regression tests ', function() { cy.get('body > .viewer a.next').click() cy.get('body > .viewer .modal-container img').should('have.length', 1) cy.get('body > .viewer .modal-container img').should('have.attr', 'src') - cy.get('body > .viewer a.next').should('be.visible') + cy.get('body > .viewer a.prev').should('be.visible') cy.get('body > .viewer a.next').should('be.visible') }) @@ -112,7 +112,7 @@ describe('Visual regression tests ', function() { cy.get('body > .viewer .modal-title').should('contain', 'test-card.png') cy.get('body > .viewer .modal-container img').should('have.length', 1) cy.get('body > .viewer .modal-container img').should('have.attr', 'src') - cy.get('body > .viewer a.next').should('be.visible') + cy.get('body > .viewer a.prev').should('be.visible') cy.get('body > .viewer a.next').should('be.visible') }) @@ -127,10 +127,10 @@ describe('Visual regression tests ', function() { cy.compareSnapshot('image2') }) - it('Take non-dav file screenshot', function() { + it('Open non-dav image', function() { const fileInfo = { filename: '/core/img/logo/logo.png', - basename: '/core/img/logo', + basename: 'logo.png', mime: 'image/png', source: '/core/img/logo/logo.png', etag: 'abc', @@ -145,6 +145,20 @@ describe('Visual regression tests ', function() { }) }) + cy.get('body > .viewer .modal-container img').should('have.length', 1) + cy.get('body > .viewer .modal-container img').should('have.attr', 'src') + cy.get('body > .viewer a.prev').should('not.be.visible') + cy.get('body > .viewer a.next').should('not.be.visible') + }) + + it('Does not see a loading animation', function() { + cy.get('body > .viewer', { timeout: 10000 }) + .should('be.visible') + .and('have.class', 'modal-mask') + .and('not.have.class', 'icon-loading') + }) + + it('Take non-dav logo.png screenshot', function() { cy.compareSnapshot('non-dav') }) }) diff --git a/cypress/snapshots/base/visual-regression.cy.js/image-base.png b/cypress/snapshots/base/visual-regression.cy.js/image-base.png index a85d652a0..c0062977d 100644 Binary files a/cypress/snapshots/base/visual-regression.cy.js/image-base.png and b/cypress/snapshots/base/visual-regression.cy.js/image-base.png differ diff --git a/cypress/snapshots/base/visual-regression.cy.js/image2-base.png b/cypress/snapshots/base/visual-regression.cy.js/image2-base.png index 735247e90..c0062977d 100644 Binary files a/cypress/snapshots/base/visual-regression.cy.js/image2-base.png and b/cypress/snapshots/base/visual-regression.cy.js/image2-base.png differ diff --git a/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png b/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png new file mode 100644 index 000000000..3c03fceee Binary files /dev/null and b/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png differ diff --git a/cypress/snapshots/base/visual-regression.cy.js/video-base.png b/cypress/snapshots/base/visual-regression.cy.js/video-base.png index c25d9dcaa..9e904c99a 100644 Binary files a/cypress/snapshots/base/visual-regression.cy.js/video-base.png and b/cypress/snapshots/base/visual-regression.cy.js/video-base.png differ diff --git a/src/components/ImageEditor.vue b/src/components/ImageEditor.vue index 434c08c8a..647bd5c0b 100644 --- a/src/components/ImageEditor.vue +++ b/src/components/ImageEditor.vue @@ -106,7 +106,7 @@ export default { return { 'data-theme-dark': true, } - } + }, }, mounted() { diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 25aa12c07..ade1096a9 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -494,7 +494,7 @@ export default { // retrieve folder list const { request: folderRequest, cancel: cancelRequestFolder } = cancelableRequest(getFileList) this.cancelRequestFolder = cancelRequestFolder - const [dirPath,] = extractFilePaths(fileInfo.filename) + const [dirPath] = extractFilePaths(fileInfo.filename) const fileList = await folderRequest(dirPath) // filter out the unwanted mimes