Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate cypress to ts #1968

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

import { configureNextcloud, startNextcloud, stopNextcloud, waitOnNextcloud } from './cypress/dockerNode'
import { defineConfig } from 'cypress'

import browserify from '@cypress/browserify-preprocessor'
import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin'

export default defineConfig({
Expand Down Expand Up @@ -40,8 +38,6 @@ export default defineConfig({
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
async setupNodeEvents(on, config) {
// Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
on('file:preprocessor', browserify())
getCompareSnapshotsPlugin(on, config)

// Disable spell checking to prevent rendering differences
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import audioTest from '../mixins/audio.js'
import audioTest from '../mixins/audio'

describe('Open audio.mp3 in viewer', function() {
audioTest('audio.mp3', 'audio/mpeg')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import audioTest from '../mixins/audio.js'
import audioTest from '../mixins/audio'

describe('Open audio.ogg in viewer', function() {
audioTest('audio.ogg', 'audio/ogg')
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image-apng.png in viewer', function() {
imageTest('image-apng.png', 'image/png')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image-small.png in viewer', function() {
imageTest('image-small.png', 'image/png')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image.gif in viewer', function() {
imageTest('image.gif', 'image/gif', '/remote.php/dav/files')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image.ico in viewer', function() {
imageTest('image.ico', 'image/x-icon', '/remote.php/dav/files')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image.png in viewer', function() {
imageTest('image.png', 'image/png')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image.svg in viewer', function() {
imageTest('image.svg', 'image/svg+xml', 'data:image/svg+xml;base64')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import imageTest from '../mixins/image.js'
import imageTest from '../mixins/image'

describe('Open image.webp in viewer', function() {
imageTest('image.webp', 'image/webp')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import runTest from '../mixins/oddname.js'
import runTest from '../mixins/oddname'

for (const [file, type] of [
['audio.mp3', 'audio/mpeg'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import runTest from '../mixins/oddname.js'
import runTest from '../mixins/oddname'

for (const [file, type] of [
['image1.jpg', 'image/jpeg'],
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/oddname/oddname-sidebar.cy.js

This file was deleted.

3 changes: 3 additions & 0 deletions cypress/e2e/oddname/oddname-sidebar.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import runTest from '../mixins/oddname'

runTest('image.png', 'image/png', true)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import runTest from '../mixins/oddname.js'
import runTest from '../mixins/oddname'

for (const [file, type] of [
['video1.mp4', 'video/mp4'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe(`Download ${fileName} in viewer`, function() {

// Open the share menu
cy.get(`.sharing-link-list > .sharing-entry > .action-item[href*='/s/${token}'] + .sharing-entry__actions .action-item__menutoggle`).click()
cy.get('.action-button:contains(\'Customize link\')').click()
cy.get('label:contains(\'Hide download\')').as('hideDownloadBtn').click()
cy.get('@hideDownloadBtn').prev('input[type=checkbox]').should('be.checked')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import videoTest from '../mixins/video.js'
import videoTest from '../mixins/video'

describe('Open video.mkv in viewer', function() {
videoTest('video.mkv', 'image/mkv')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import videoTest from '../mixins/video.js'
import videoTest from '../mixins/video'

describe('Open video1.mp4 in viewer', function() {
videoTest('video1.mp4', 'video/mp4')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import videoTest from '../mixins/video.js'
import videoTest from '../mixins/video'

describe('Open video.ogv in viewer', function() {
videoTest('video.ogv', 'video/ogv')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import videoTest from '../mixins/video.js'
import videoTest from '../mixins/video'

describe('Open video.webm in viewer', function() {
videoTest('video.webm', 'video/webm')
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cypress/support/e2e.js → cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands.js'
import './commands'
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.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading