From fa62f01835b24e23217f98abcce74ed365131a25 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 26 May 2021 10:53:04 +0200 Subject: [PATCH] Add tests for settings Signed-off-by: Louis Chemineau --- cypress.json | 2 +- cypress/integration/settings.spec.js | 119 ++++ .../{activity.spec.js => sidebar.spec.js} | 4 +- cypress/support/commands.js | 91 +-- cypress/support/index.js | 5 +- cypress/support/sidebar.js | 112 ++++ package-lock.json | 547 ------------------ package.json | 4 +- src/tests/__snapshots__/Activity.test.js.snap | 18 +- src/tests/setup.js | 2 + 10 files changed, 249 insertions(+), 655 deletions(-) create mode 100644 cypress/integration/settings.spec.js rename cypress/integration/{activity.spec.js => sidebar.spec.js} (96%) create mode 100644 cypress/support/sidebar.js diff --git a/cypress.json b/cypress.json index f58dd3916..15f2bcd54 100644 --- a/cypress.json +++ b/cypress.json @@ -3,4 +3,4 @@ "projectId": "hx9gqy", "viewportWidth": 1280, "viewportHeight": 720 -} +} \ No newline at end of file diff --git a/cypress/integration/settings.spec.js b/cypress/integration/settings.spec.js new file mode 100644 index 000000000..e07b416c4 --- /dev/null +++ b/cypress/integration/settings.spec.js @@ -0,0 +1,119 @@ +/** + * @copyright Copyright (c) 2021 Louis Chemineau + * + * @author Louis Chemineau + * + * @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 . + * + */ + +/// + +import { randHash } from '../utils' +const randUser = randHash() + +describe('Check that user\'s settings survive a reload', () => { + before(() => { + cy.nextcloudCreateUser(randUser, 'password') + cy.login(randUser, 'password') + cy.visit('/settings/user/activity') + cy.wait(1000) + }) + + after(() => { + cy.logout() + }) + + it('Form survive a reload', () => { + cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked') + + cy.reload() + + cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked') + + cy.get("#file_changed_notification").check({force: true}) + cy.contains("A calendar was modified").click() + cy.contains("Other activities").parentsUntil('table').contains("Push").click() + cy.contains("Comments for files").click() + cy.contains("Your password or email was modified").click() + + cy.reload() + + cy.get("#file_favorite_changed_email").should('not.be.checked') + cy.get("#file_favorite_changed_notification").should('not.be.checked') + cy.get("#file_changed_email").should('not.be.checked') + cy.get("#file_changed_notification").should('be.checked') + cy.get("#favorite_email").should('not.be.checked') + cy.get("#favorite_notification").should('not.be.checked') + cy.get("#shared_email").should('not.be.checked') + cy.get("#shared_notification").should('not.be.checked') + cy.get("#remote_share_email").should('not.be.checked') + cy.get("#remote_share_notification").should('not.be.checked') + cy.get("#public_links_email").should('not.be.checked') + cy.get("#public_links_notification").should('not.be.checked') + cy.get("#calendar_email").should('be.checked') + cy.get("#calendar_notification").should('be.checked') + cy.get("#calendar_event_email").should('not.be.checked') + cy.get("#calendar_event_notification").should('not.be.checked') + cy.get("#calendar_todo_email").should('not.be.checked') + cy.get("#calendar_todo_notification").should('not.be.checked') + cy.get("#contacts_email").should('not.be.checked') + cy.get("#contacts_notification").should('not.be.checked') + cy.get("#group_settings_email").should('not.be.checked') + cy.get("#group_settings_notification").should('be.checked') + cy.get("#personal_settings_email").should('not.be.checked') + cy.get("#personal_settings_notification").should('not.be.checked') + cy.get("#security_email").should('not.be.checked') + cy.get("#security_notification").should('be.checked') + cy.get("#comments_email").should('be.checked') + cy.get("#comments_notification").should('be.checked') + cy.get("#systemtags_email").should('not.be.checked') + cy.get("#systemtags_notification").should('be.checked') + }) + + it('Notification frequency survive a reload', () => { + cy.get(".notification-frequency__select").select("Weekly") + + cy.wait(200) + cy.reload() + + cy.get('.notification-frequency__select').find(':selected').contains('Weekly') + cy.get(".notification-frequency__select").select("Hourly") + + cy.wait(200) + cy.reload() + + cy.get('.notification-frequency__select').find(':selected').contains('Hourly') + }) + + it('Activity summary survive a reload', () => { + let input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section.summary-form').children('input') + + input.check({force: true}) + + cy.reload() + input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section.summary-form').children('input') + + input.should('be.checked') + + input.uncheck({force: true}) + + cy.reload() + input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section.summary-form').children('input') + + input.should('not.be.checked') + }) +}) diff --git a/cypress/integration/activity.spec.js b/cypress/integration/sidebar.spec.js similarity index 96% rename from cypress/integration/activity.spec.js rename to cypress/integration/sidebar.spec.js index 2996a0d29..7db546ec5 100644 --- a/cypress/integration/activity.spec.js +++ b/cypress/integration/sidebar.spec.js @@ -20,10 +20,12 @@ * */ +/// + import { randHash } from '../utils' const randUser = randHash() -describe('Open test.md in viewer', function() { +describe('Check activity listing in the sidebar', function() { before(function() { cy.nextcloudCreateUser(randUser, 'password') cy.login(randUser, 'password') diff --git a/cypress/support/commands.js b/cypress/support/commands.js index d62404dca..d57e6aaf7 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -20,7 +20,7 @@ * */ -import axios from '@nextcloud/axios' +/// const url = Cypress.config('baseUrl').replace(/\/index.php\/?$/g, '') Cypress.env('baseUrl', url) @@ -68,92 +68,3 @@ Cypress.Commands.add('nextcloudCreateUser', (user, password) => { cy.log(`Created user ${user}`, response.status) }) }) - -Cypress.Commands.add('createFolder', dirName => { - cy.get('#controls .actions > .button.new').click() - cy.get('#controls .actions .newFileMenu a[data-action="folder"]').click() - cy.get('#controls .actions .newFileMenu a[data-action="folder"] input[type="text"]').type(dirName) - cy.get('#controls .actions .newFileMenu a[data-action="folder"] input.icon-confirm').click() - cy.log('Created folder', dirName) - cy.wait(500) -}) - -Cypress.Commands.add('moveFile', (fileName, dirName) => { - cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() - cy.get(`#fileList tr[data-file="${fileName}"] .action-movecopy`).click() - cy.get(`.oc-dialog tr[data-entryname="${dirName}"]`).click() - cy.contains(`Move to ${dirName}`).click() - cy.wait(500) -}) - -Cypress.Commands.add('showSidebarForFile', fileName => { - cy.hideSidebar('welcome.txt') - cy.get('#fileList tr[data-file="welcome.txt"] .icon-more').click() - cy.contains('Details').click() - cy.get('#app-sidebar-vue').contains('Activity').click() -}) - -Cypress.Commands.add('hideSidebar', fileName => { - cy.get('body') - .then(($body) => { - if ($body.find('.app-sidebar__close').length !== 0) { - cy.get('.app-sidebar__close').click() - } - }) -}) - -Cypress.Commands.add('showActivityTab', fileName => { - cy.showSidebarForFile() - cy.get('#app-sidebar-vue').contains('Activity').click() -}) - -Cypress.Commands.add('addToFavorites', fileName => { - cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() - cy.contains('Add to favorites').click() -}) - -Cypress.Commands.add('removeFromFavorites', fileName => { - cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() - cy.contains('Remove from favorites').click() -}) - -Cypress.Commands.add('createPublicShare', fileName => { - cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() - cy.contains('Details').click() - cy.get('#app-sidebar-vue').contains('Sharing').click() - - cy.get('#app-sidebar-vue a#sharing').trigger('click') - cy.get('#app-sidebar-vue button.new-share-link').trigger('click') - cy.get('#app-sidebar-vue a.sharing-entry__copy') -}) - -Cypress.Commands.add('renameFile', (fileName, newName) => { - cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() - cy.get(`#fileList tr[data-file="${fileName}"] .action-rename`).click() - cy.get(`#fileList tr[data-file="${fileName}"] input.filename`).type(newName).parent().submit() - cy.wait(500) -}) - -Cypress.Commands.add('goToDir', (dirName) => { - cy.get(`#fileList tr[data-file="${dirName}"]`).click() - cy.wait(500) -}) - -Cypress.Commands.add('addTag', (fileName, tag) => { - cy.showSidebarForFile('welcome.txt') - - cy.get('.app-sidebar-header__menu .action-item__menutoggle').click() - cy.get('.action-button__icon.icon-tag').click() - cy.get('.systemTagsInputField input').type('my_tag{enter}{esc}') - - cy.wait(500) -}) - -Cypress.Commands.add('addComment', (fileName, comment) => { - cy.showSidebarForFile('welcome.txt') - cy.get('#app-sidebar-vue').contains('Comments').click() - cy.get('.comment__editor .rich-contenteditable__input').type(comment) - cy.get('input.comment__submit').click() - - cy.wait(500) -}) diff --git a/cypress/support/index.js b/cypress/support/index.js index d68db96df..7a2a87b49 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -13,8 +13,5 @@ // https://on.cypress.io/configuration // *********************************************************** -// Import commands.js using ES2015 syntax: import './commands' - -// Alternatively you can use CommonJS syntax: -// require('./commands') +import './sidebar' diff --git a/cypress/support/sidebar.js b/cypress/support/sidebar.js new file mode 100644 index 000000000..a4cfaad03 --- /dev/null +++ b/cypress/support/sidebar.js @@ -0,0 +1,112 @@ +/** + * @copyright Copyright (c) 2021 Louis Chemineau + * + * @author Louis Chemineau + * + * @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 . + * + */ + +/// + +Cypress.Commands.add('createFolder', dirName => { + cy.get('#controls .actions > .button.new').click() + cy.get('#controls .actions .newFileMenu a[data-action="folder"]').click() + cy.get('#controls .actions .newFileMenu a[data-action="folder"] input[type="text"]').type(dirName) + cy.get('#controls .actions .newFileMenu a[data-action="folder"] input.icon-confirm').click() + cy.log('Created folder', dirName) + cy.wait(500) +}) + +Cypress.Commands.add('moveFile', (fileName, dirName) => { + cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() + cy.get(`#fileList tr[data-file="${fileName}"] .action-movecopy`).click() + cy.get(`.oc-dialog tr[data-entryname="${dirName}"]`).click() + cy.contains(`Move to ${dirName}`).click() + cy.wait(500) +}) + +Cypress.Commands.add('showSidebarForFile', fileName => { + cy.hideSidebar('welcome.txt') + cy.get('#fileList tr[data-file="welcome.txt"] .icon-more').click() + cy.contains('Details').click() + cy.get('#app-sidebar-vue').contains('Activity').click() +}) + +Cypress.Commands.add('hideSidebar', fileName => { + cy.get('body') + .then(($body) => { + if ($body.find('.app-sidebar__close').length !== 0) { + cy.get('.app-sidebar__close').click() + } + }) +}) + +Cypress.Commands.add('showActivityTab', fileName => { + cy.showSidebarForFile() + cy.get('#app-sidebar-vue').contains('Activity').click() +}) + +Cypress.Commands.add('addToFavorites', fileName => { + cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() + cy.contains('Add to favorites').click() +}) + +Cypress.Commands.add('removeFromFavorites', fileName => { + cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() + cy.contains('Remove from favorites').click() +}) + +Cypress.Commands.add('createPublicShare', fileName => { + cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() + cy.contains('Details').click() + cy.get('#app-sidebar-vue').contains('Sharing').click() + + cy.get('#app-sidebar-vue a#sharing').trigger('click') + cy.get('#app-sidebar-vue button.new-share-link').trigger('click') + cy.get('#app-sidebar-vue a.sharing-entry__copy') +}) + +Cypress.Commands.add('renameFile', (fileName, newName) => { + cy.get(`#fileList tr[data-file="${fileName}"] .icon-more`).click() + cy.get(`#fileList tr[data-file="${fileName}"] .action-rename`).click() + cy.get(`#fileList tr[data-file="${fileName}"] input.filename`).type(newName).parent().submit() + cy.wait(500) +}) + +Cypress.Commands.add('goToDir', (dirName) => { + cy.get(`#fileList tr[data-file="${dirName}"]`).click() + cy.wait(500) +}) + +Cypress.Commands.add('addTag', (fileName, tag) => { + cy.showSidebarForFile('welcome.txt') + + cy.get('.app-sidebar-header__menu .action-item__menutoggle').click() + cy.get('.action-button__icon.icon-tag').click() + cy.get('.systemTagsInputField input').type('my_tag{enter}{esc}') + + cy.wait(500) +}) + +Cypress.Commands.add('addComment', (fileName, comment) => { + cy.showSidebarForFile('welcome.txt') + cy.get('#app-sidebar-vue').contains('Comments').click() + cy.get('.comment__editor .rich-contenteditable__input').type(comment) + cy.get('input.comment__submit').click() + + cy.wait(500) +}) diff --git a/package-lock.json b/package-lock.json index 72378db38..db2f063b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,6 @@ "babel-core": "^7.0.0-bridge.0", "cypress": "^7.2.0", "jest": "^26.6.3", - "jest-environment-jsdom-sixteen": "^2.0.0", "jest-serializer-vue": "^2.0.2", "vue-jest": "^3.0.7" }, @@ -11580,304 +11579,6 @@ "node": ">= 10.14.2" } }, - "node_modules/jest-environment-jsdom-sixteen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom-sixteen/-/jest-environment-jsdom-sixteen-2.0.0.tgz", - "integrity": "sha512-BF+8P67aEJcd78TQzwSb9P4a73cArOWb5KgqI8eU6cHRWDIJdDRE8XTeZAmOuDSDhKpuEXjKkXwWB3GOJvqHJQ==", - "deprecated": "jest@26 ships with jsdom@16, so there is no reason to use this module", - "dev": true, - "dependencies": { - "@jest/fake-timers": "^25.1.0", - "jest-mock": "^25.1.0", - "jest-util": "^25.1.0", - "jsdom": "^16.2.1" - }, - "engines": { - "node": "^10.14.2 || >= 12.0.0" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/@jest/fake-timers": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.5.0.tgz", - "integrity": "sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ==", - "dev": true, - "dependencies": { - "@jest/types": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-util": "^25.5.0", - "lolex": "^5.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/@types/stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", - "dev": true - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/jest-message-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz", - "integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^25.5.0", - "@types/stack-utils": "^1.0.1", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "slash": "^3.0.0", - "stack-utils": "^1.0.1" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/jest-mock": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-25.5.0.tgz", - "integrity": "sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA==", - "dev": true, - "dependencies": { - "@jest/types": "^25.5.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/jest-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.5.0.tgz", - "integrity": "sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA==", - "dev": true, - "dependencies": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "make-dir": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/stack-utils": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", - "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom-sixteen/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/jest-environment-node": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", @@ -14162,15 +13863,6 @@ "node": ">=8" } }, - "node_modules/lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, "node_modules/longest-streak": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", @@ -30201,236 +29893,6 @@ "jsdom": "^16.4.0" } }, - "jest-environment-jsdom-sixteen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom-sixteen/-/jest-environment-jsdom-sixteen-2.0.0.tgz", - "integrity": "sha512-BF+8P67aEJcd78TQzwSb9P4a73cArOWb5KgqI8eU6cHRWDIJdDRE8XTeZAmOuDSDhKpuEXjKkXwWB3GOJvqHJQ==", - "dev": true, - "requires": { - "@jest/fake-timers": "^25.1.0", - "jest-mock": "^25.1.0", - "jest-util": "^25.1.0", - "jsdom": "^16.2.1" - }, - "dependencies": { - "@jest/fake-timers": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.5.0.tgz", - "integrity": "sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0", - "jest-message-util": "^25.5.0", - "jest-mock": "^25.5.0", - "jest-util": "^25.5.0", - "lolex": "^5.0.0" - } - }, - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "@types/stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "jest-message-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz", - "integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^25.5.0", - "@types/stack-utils": "^1.0.1", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "slash": "^3.0.0", - "stack-utils": "^1.0.1" - } - }, - "jest-mock": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-25.5.0.tgz", - "integrity": "sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0" - } - }, - "jest-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.5.0.tgz", - "integrity": "sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "make-dir": "^3.0.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "stack-utils": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", - "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, "jest-environment-node": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", @@ -32170,15 +31632,6 @@ } } }, - "lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, "longest-streak": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", diff --git a/package.json b/package.json index 80bcaa7be..ac4644a8c 100644 --- a/package.json +++ b/package.json @@ -41,14 +41,13 @@ "json", "vue" ], - "testEnvironment": "jest-environment-jsdom-sixteen", "transform": { "^.+\\.js$": "babel-jest", "^.+\\.vue$": "vue-jest" }, "transformIgnorePatterns": [ "\\.pnp\\.[^\\/]+$", - "/node_modules/(?!(@juliushaertl/vue-richtext)/)" + "/node_modules/(?!(@juliushaertl/vue-richtext|vue-material-design-icons)/)" ], "snapshotSerializers": [ "/node_modules/jest-serializer-vue" @@ -97,7 +96,6 @@ "babel-core": "^7.0.0-bridge.0", "cypress": "^7.2.0", "jest": "^26.6.3", - "jest-environment-jsdom-sixteen": "^2.0.0", "jest-serializer-vue": "^2.0.2", "vue-jest": "^3.0.7" } diff --git a/src/tests/__snapshots__/Activity.test.js.snap b/src/tests/__snapshots__/Activity.test.js.snap index 8a07d8e21..df37332c6 100644 --- a/src/tests/__snapshots__/Activity.test.js.snap +++ b/src/tests/__snapshots__/Activity.test.js.snap @@ -3,7 +3,7 @@ exports[`Display correct information for changes 1`] = `
  • -
    +
    @@ -28,7 +28,7 @@ exports[`Display correct information for changes 1`] = ` exports[`Display correct information for comments 1`] = `
  • -
    +
    @@ -53,7 +53,7 @@ exports[`Display correct information for comments 1`] = ` exports[`Display correct information for creations 1`] = `
  • -
    +
    @@ -78,7 +78,7 @@ exports[`Display correct information for creations 1`] = ` exports[`Display correct information for favorites 1`] = `
  • -
    +
    @@ -103,7 +103,7 @@ exports[`Display correct information for favorites 1`] = ` exports[`Display correct information for moves 1`] = `
  • -
    +
    @@ -128,7 +128,7 @@ exports[`Display correct information for moves 1`] = ` exports[`Display correct information for renames 1`] = `
  • -
    +
    @@ -153,7 +153,7 @@ exports[`Display correct information for renames 1`] = ` exports[`Display correct information for shares 1`] = `
  • -
    +
    @@ -178,7 +178,7 @@ exports[`Display correct information for shares 1`] = ` exports[`Display correct information for tags 1`] = `
  • -
    +
    @@ -203,7 +203,7 @@ exports[`Display correct information for tags 1`] = ` exports[`Display correct information for unfavorites 1`] = `
  • -
    +
    diff --git a/src/tests/setup.js b/src/tests/setup.js index 96b67d34d..b50836096 100644 --- a/src/tests/setup.js +++ b/src/tests/setup.js @@ -21,6 +21,8 @@ */ import OC from './OC.js' +// eslint-disable-next-line node/no-extraneous-import +import 'regenerator-runtime/runtime' import Vue from 'vue' import { translate as t, translatePlural as n } from '@nextcloud/l10n'