Skip to content

Commit 9f3adff

Browse files
committed
Update tests
Signed-off-by: John Molakvoæ <[email protected]>
1 parent a2d8267 commit 9f3adff

File tree

12 files changed

+17
-132
lines changed

12 files changed

+17
-132
lines changed

cypress/fixtures/test-card.mp4

46.1 KB
Binary file not shown.

cypress/fixtures/test-card.png

18.8 KB
Loading

cypress/integration/image.png.spec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ describe('Open image.png in viewer', function() {
5757
.and('not.have.class', 'icon-loading')
5858
})
5959

60-
it('Is not in mobile fullscreen mode', function() {
61-
cy.get('body > .viewer .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
62-
})
63-
6460
it('See the menu icon and title on the viewer header', function() {
6561
cy.get('body > .viewer .modal-title').should('contain', 'image.png')
6662
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible')

cypress/integration/image.webp.spec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ describe('Open image.webp in viewer', function() {
5757
.and('not.have.class', 'icon-loading')
5858
})
5959

60-
it('Is not in mobile fullscreen mode', function() {
61-
cy.get('body > .viewer .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
62-
})
63-
6460
it('See the menu icon and title on the viewer header', function() {
6561
cy.get('body > .viewer .modal-title').should('contain', 'image.webp')
6662
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible')

cypress/integration/visual-regression.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ describe('Open mp4 videos in viewer', function() {
3030
cy.login(randUser, 'password')
3131

3232
// Upload test file
33-
cy.uploadFile('video1.mp4', 'video/mp4')
34-
cy.uploadFile('image1.jpg', 'image/jpeg')
33+
cy.uploadFile('test-card.mp4', 'video/mp4')
34+
cy.uploadFile('test-card.png', 'image/png')
3535
cy.visit('/apps/files')
3636

3737
// wait a bit for things to be settled
@@ -42,19 +42,19 @@ describe('Open mp4 videos in viewer', function() {
4242
})
4343

4444
it('See files in the list', function() {
45-
cy.get('#fileList tr[data-file="video1.mp4"]', { timeout: 10000 })
46-
.should('contain', 'video1.mp4')
47-
cy.get('#fileList tr[data-file="image1.jpg"]', { timeout: 10000 })
48-
.should('contain', 'image1.jpg')
45+
cy.get('#fileList tr[data-file="test-card.mp4"]', { timeout: 10000 })
46+
.should('contain', 'test-card.mp4')
47+
cy.get('#fileList tr[data-file="test-card.png"]', { timeout: 10000 })
48+
.should('contain', 'test-card.png')
4949
})
5050

5151
it('Open the viewer on file click', function() {
52-
cy.openFile('video1.mp4')
52+
cy.openFile('test-card.mp4')
5353
cy.get('body > .viewer').should('be.visible')
5454
})
5555

5656
it('See the menu icon and title on the viewer header', function() {
57-
cy.get('body > .viewer .modal-title').should('contain', 'video1.mp4')
57+
cy.get('body > .viewer .modal-title').should('contain', 'test-card.mp4')
5858
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible')
5959
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
6060
})
@@ -63,7 +63,7 @@ describe('Open mp4 videos in viewer', function() {
6363
cy.get('body > .viewer .modal-container video').should('have.length', 1)
6464
cy.get('body > .viewer .modal-container .viewer__file.viewer__file--active video')
6565
.should('have.attr', 'src')
66-
.and('contain', `/remote.php/dav/files/${randUser}/video1.mp4`)
66+
.and('contain', `/remote.php/dav/files/${randUser}/test-card.mp4`)
6767
cy.get('body > .viewer a.next').should('be.visible')
6868
cy.get('body > .viewer a.next').should('be.visible')
6969
})
@@ -75,7 +75,7 @@ describe('Open mp4 videos in viewer', function() {
7575
.and('not.have.class', 'icon-loading')
7676
})
7777

78-
it('Take screenshot 1', function() {
78+
it('Take test-card.mp4 screenshot', function() {
7979
cy.get('body > .viewer .modal-container .viewer__file.viewer__file--active video').then(video => {
8080
video.get(0).pause()
8181
video.get(0).currentTime = 1
@@ -100,7 +100,7 @@ describe('Open mp4 videos in viewer', function() {
100100
.and('not.have.class', 'icon-loading')
101101
})
102102

103-
it('Take screenshot 2', function() {
103+
it('Take test-card.png screenshot', function() {
104104
cy.compareSnapshot('image')
105105
})
106106
})
-1.18 MB
Loading
-489 KB
Loading

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)