Skip to content

Commit

Permalink
Merge pull request #577 from nextcloud/heic
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Sep 16, 2020
2 parents a70a8bb + 31a3376 commit 6f3b742
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 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()
})
})
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/models/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
group: 'media',
mimes: [
'image/png',
'image/heic',
'image/jpeg',
'image/gif',
'image/x-xbitmap',
Expand Down

0 comments on commit 6f3b742

Please sign in to comment.