Skip to content

Commit

Permalink
Add heic integration test
Browse files Browse the repository at this point in the history
Example file is from https://www.online-convert.com/file-format/heic and under CC-BY http://www.online-convert.com

Signed-off-by: Morris Jobke <[email protected]>
  • Loading branch information
MorrisJobke committed Sep 16, 2020
1 parent 2d92b20 commit 46018c3
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
Binary file added cypress/fixtures/image.heic
Binary file not shown.
79 changes: 79 additions & 0 deletions cypress/integration/image.heic.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* @copyright Copyright (c) 2019 John Molakvoæ <[email protected]>
*
* @author John Molakvoæ <[email protected]>
* @author Morris Jobke <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

import { randHash } from '../utils/'
const randUser = randHash()

describe('Open image.heic in viewer', function() {
before(function() {
// Init user
cy.nextcloudCreateUser(randUser, 'password')
cy.login(randUser, 'password')

// Upload test files
cy.uploadFile('image.heic', 'image/heic')
cy.visit('/apps/files')

// wait a bit for things to be settled
cy.wait(2000)
})
after(function() {
cy.logout()
})

it('See image.heic in the list', function() {
cy.get('#fileList tr[data-file="image.heic"]', { timeout: 10000 })
.should('contain', 'image.heic')
})

it('Open the viewer on file click', function() {
cy.openFile('image.heic')
cy.get('#viewer-content').should('be.visible')
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
})

it('Is not in mobile fullscreen mode', function() {
cy.get('#viewer-content .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
})

it('See the menu icon and title on the viewer header', function() {
cy.get('#viewer-content .modal-title').should('contain', 'image.heic')
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
})

it('Does not see navigation arrows', function() {
cy.get('#viewer-content a.prev').should('not.be.visible')
cy.get('#viewer-content a.next').should('not.be.visible')
})

it('Does not have any visual regression', function() {
cy.matchImageSnapshot()
})
})

0 comments on commit 46018c3

Please sign in to comment.