Skip to content

Commit

Permalink
Merge pull request #2503 from nextcloud/automated/noid/stable28-cypre…
Browse files Browse the repository at this point in the history
…ss-snapshot-update
  • Loading branch information
skjnldsv authored Sep 14, 2024
2 parents b6aeca9 + 12725b2 commit 2ae4354
Show file tree
Hide file tree
Showing 46 changed files with 1,681 additions and 2,224 deletions.
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"globals": {
"appName": true,
"appVersion": true,
"PLYR_ICONS": true,
"oc_defaults": true,
"__dirname": true
},
"extends": [
"@nextcloud/eslint-config/typescript"
]
}
3 changes: 1 addition & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Install node dependencies & build app
run: |
npm ci
TESTING=true npm run build --if-present
npm run build --if-present
- name: Save context
uses: buildjet/cache/save@e376f15c6ec6dc595375c78633174c7e5f92dc0e # v3
Expand Down Expand Up @@ -112,7 +112,6 @@ jobs:
# https://github.com/cypress-io/github-action/issues/124
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
# Needed for some specific code workarounds
TESTING: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
SPLIT: ${{ matrix.total-containers }}
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const babelConfig = require('@nextcloud/babel-config')

babelConfig.plugins.push('@babel/plugin-proposal-class-properties')
babelConfig.plugins.push('@babel/plugin-transform-private-methods')

module.exports = babelConfig
1 change: 0 additions & 1 deletion css/viewer-index.css

This file was deleted.

62 changes: 0 additions & 62 deletions css/viewer-main.css

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/e2e/a11y.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('A11y tests', function() {
})

it('See the title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image2.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image2.jpg')
})

it('Should have rendered the previous video and the next image', function() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/actions/sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Open the sidebar from the viewer and open viewer with sidebar already
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/audios/audios.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Open mp3 and ogg audio in viewer', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'audio.mp3')
cy.get('body > .viewer .modal-header__name').should('contain', 'audio.mp3')
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/images/images-custom-list-loadmore.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
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')
})
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/images/images-custom-list.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Open custom images list in viewer', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
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')
})
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('Open custom images list in viewer', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image3.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image3.jpg')
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')
})
Expand All @@ -160,7 +160,7 @@ describe('Open custom images list in viewer', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/images/images.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('Open images in viewer', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/mixins/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function(fileName = 'audio.ogg', mimeType = 'audio/ogg') {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', fileName)
cy.get('body > .viewer .modal-header__name').should('contain', fileName)
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/mixins/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function(fileName = 'image1.jpg', mimeType = 'image/jpeg', source
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', fileName)
cy.get('body > .viewer .modal-header__name').should('contain', fileName)
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/mixins/oddname.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function(file, type, sidebar = false) {
*/
function menuOk() {
cy.get('body > .viewer .icon-error').should('not.exist')
cy.get('body > .viewer .modal-name').should('contain', placedName)
cy.get('body > .viewer .modal-header__name').should('contain', placedName)
cy.get('body > .viewer .modal-header button.header-close').should(
'be.visible',
)
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/mixins/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function(fileName = 'image1.jpg', mimeType = 'image/jpeg') {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', fileName)
cy.get('body > .viewer .modal-header__name').should('contain', fileName)
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')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/non-dav-files.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Open non-dav files in viewer', function() {
})

it('See the title and close button on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', basename)
cy.get('body > .viewer .modal-header__name').should('contain', basename)
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
})

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/sharing/download-share-disabled.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe(`Download ${fileName} in viewer`, function() {
})

it('See the title on the viewer header but not the Download nor the menu button', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
cy.get('body a[download="image1.jpg"]').should('not.exist')
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('not.exist')
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/sharing/download-share.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe(`Download ${fileName} from viewer in link share`, function() {
})

it('See the title and the close icon on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
})

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/sharing/files-shares.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('See shared folder with link share', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
})

Expand Down Expand Up @@ -141,7 +141,7 @@ describe('See shared folder with link share', function() {
cy.get('body > .viewer .modal-container video').should('have.length', 1)
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer .modal-name').should('contain', 'video1.mp4')
cy.get('body > .viewer .modal-header__name').should('contain', 'video1.mp4')
})

it('Does not see a loading animation', function() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/videos/videos.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Open mp4 videos in viewer', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'video1.mp4')
cy.get('body > .viewer .modal-header__name').should('contain', 'video1.mp4')
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')
})
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/visual-regression.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ describe('Visual regression tests', function() {
})

it('See files in the list', function() {
// TODO: Do we care about the file name being split by a ' ' in the text property?
cy.getFile('test-card.mp4', { timeout: 10000 })
.should('contain', 'test-card .mp4')
cy.getFile('test-card.png', { timeout: 10000 })
.should('contain', 'test-card .png')
})

it('Open the viewer on file click', function() {
cy.intercept('GET', '**/viewer/css/fonts/roboto-*').as('roboto-font')
cy.intercept('GET', '**/viewer/js/*roboto_index_css*').as('roboto-font')
cy.intercept('GET', '**/core/preview*').as('image1')
cy.intercept('GET', '/remote.php/dav/files/*/test-card.mp4').as('video')
cy.openFile('test-card.mp4')
Expand All @@ -65,7 +66,7 @@ describe('Visual regression tests', function() {
})

it('See the menu icon and title on the viewer header', function() {
cy.get('body > .viewer .modal-name').should('contain', 'test-card.mp4')
cy.get('body > .viewer .modal-header__name').should('contain', 'test-card.mp4')
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')
})
Expand Down Expand Up @@ -124,7 +125,7 @@ describe('Visual regression tests', function() {
cy.openFile('test-card.png')

cy.get('body > .viewer').should('be.visible')
cy.get('body > .viewer .modal-name').should('contain', 'test-card.png')
cy.get('body > .viewer .modal-header__name').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 button.prev').should('be.visible')
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions js/viewer-filerobot.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2ae4354

Please sign in to comment.