mirror of
https://github.com/nextcloud/server.git
synced 2026-06-16 20:19:48 -04:00
chore(cypress): adjust files-sidebar.cy.ts
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
12a2c0fc19
commit
a2ea37921f
8 changed files with 151 additions and 44 deletions
|
|
@ -23,7 +23,7 @@
|
|||
<template>
|
||||
<NcAppSidebar v-if="file"
|
||||
ref="sidebar"
|
||||
cy-data-sidebar
|
||||
data-cy-sidebar
|
||||
v-bind="appSidebar"
|
||||
:force-menu="true"
|
||||
@close="close"
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ export const navigateToFolder = (dirPath: string) => {
|
|||
|
||||
export const closeSidebar = () => {
|
||||
// {force: true} as it might be hidden behind toasts
|
||||
cy.get('[cy-data-sidebar] .app-sidebar__close').click({ force: true })
|
||||
cy.get('[data-cy-sidebar] .app-sidebar__close').click({ force: true })
|
||||
}
|
||||
|
||||
export const clickOnBreadcrumbs = (label: string) => {
|
||||
|
|
|
|||
|
|
@ -1,23 +1,6 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2024 Ferdinand Thiessen <opensource@fthiessen.de>
|
||||
*
|
||||
* @author Ferdinand Thiessen <opensource@fthiessen.de>
|
||||
*
|
||||
* @license AGPL-3.0-or-later
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { User } from '@nextcloud/cypress'
|
||||
|
|
@ -44,7 +27,10 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
|
|||
|
||||
triggerActionForFile('file', 'details')
|
||||
|
||||
cy.get('[cy-data-sidebar]').should('be.visible')
|
||||
cy.get('[data-cy-sidebar]')
|
||||
.should('be.visible')
|
||||
.findByRole('heading', { name: 'file' })
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('changes the current fileid', () => {
|
||||
|
|
@ -53,7 +39,7 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
|
|||
|
||||
triggerActionForFile('file', 'details')
|
||||
|
||||
cy.get('[cy-data-sidebar]').should('be.visible')
|
||||
cy.get('[data-cy-sidebar]').should('be.visible')
|
||||
cy.url().should('contain', `apps/files/files/${fileId}`)
|
||||
})
|
||||
|
||||
|
|
@ -84,7 +70,8 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
|
|||
// open the sidebar
|
||||
triggerActionForFile('file', 'details')
|
||||
// validate it is open
|
||||
cy.get('[cy-data-sidebar]').should('be.visible')
|
||||
cy.get('[data-cy-sidebar]')
|
||||
.should('be.visible')
|
||||
|
||||
// if we navigate to the folder
|
||||
navigateToFolder('folder')
|
||||
|
|
@ -104,7 +91,10 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
|
|||
cy.get('[data-cy-sidebar]').should('be.visible')
|
||||
// delete the file
|
||||
triggerActionForFile('file', 'delete')
|
||||
cy.get('[cy-data-sidebar]').should('not.exist')
|
||||
cy.wait('@deleteFile', { timeout: 10000 })
|
||||
// see the sidebar is closed
|
||||
cy.get('[data-cy-sidebar]')
|
||||
.should(assertNotExistOrNotVisible)
|
||||
})
|
||||
|
||||
it('changes the fileid on delete', () => {
|
||||
|
|
@ -122,11 +112,13 @@ describe('Files: Sidebar', { testIsolation: true }, () => {
|
|||
// open the sidebar
|
||||
triggerActionForFile('other', 'details')
|
||||
// validate it is open
|
||||
cy.get('[cy-data-sidebar]').should('be.visible')
|
||||
cy.get('[data-cy-sidebar]').should('be.visible')
|
||||
cy.url().should('contain', `apps/files/files/${otherFileId}`)
|
||||
|
||||
triggerActionForFile('other', 'delete')
|
||||
cy.get('[cy-data-sidebar]').should('not.exist')
|
||||
cy.wait('@deleteFile')
|
||||
|
||||
cy.get('[data-cy-sidebar]').should('not.exist')
|
||||
// Ensure the URL is changed
|
||||
cy.url().should('not.contain', `apps/files/files/${otherFileId}`)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import { addCommands, User } from '@nextcloud/cypress'
|
|||
import { basename } from 'path'
|
||||
|
||||
// Add custom commands
|
||||
import '@testing-library/cypress/add-commands'
|
||||
import 'cypress-if'
|
||||
import 'cypress-wait-until'
|
||||
addCommands()
|
||||
|
|
|
|||
4
dist/files-sidebar.js
vendored
4
dist/files-sidebar.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-sidebar.js.map
vendored
2
dist/files-sidebar.js.map
vendored
File diff suppressed because one or more lines are too long
139
package-lock.json
generated
139
package-lock.json
generated
|
|
@ -102,6 +102,7 @@
|
|||
"@nextcloud/typings": "^1.8.0",
|
||||
"@nextcloud/webpack-vue-config": "^6.0.1",
|
||||
"@pinia/testing": "^0.1.2",
|
||||
"@testing-library/cypress": "^10.0.2",
|
||||
"@testing-library/jest-dom": "^6.1.5",
|
||||
"@testing-library/user-event": "^14.4.3",
|
||||
"@testing-library/vue": "^5.8.3",
|
||||
|
|
@ -117,7 +118,7 @@
|
|||
"babel-plugin-module-resolver": "^5.0.2",
|
||||
"colord": "^2.9.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"cypress": "^13.7.3",
|
||||
"cypress": "^13.13.2",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"cypress-if": "^1.12.3",
|
||||
"cypress-split": "^1.21.2",
|
||||
|
|
@ -5271,6 +5272,121 @@
|
|||
"string.prototype.matchall": "^4.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@testing-library/cypress": {
|
||||
"version": "10.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-10.0.2.tgz",
|
||||
"integrity": "sha512-dKv95Bre5fDmNb9tOIuWedhGUryxGu1GWYWtXDqUsDPcr9Ekld0fiTb+pcBvSsFpYXAZSpmyEjhoXzLbhh06yQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.6",
|
||||
"@testing-library/dom": "^10.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12",
|
||||
"npm": ">=6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"cypress": "^12.0.0 || ^13.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@testing-library/cypress/node_modules/@testing-library/dom": {
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz",
|
||||
"integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.10.4",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@types/aria-query": "^5.0.1",
|
||||
"aria-query": "5.3.0",
|
||||
"chalk": "^4.1.0",
|
||||
"dom-accessibility-api": "^0.5.9",
|
||||
"lz-string": "^1.5.0",
|
||||
"pretty-format": "^27.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@testing-library/cypress/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/@testing-library/cypress/node_modules/aria-query": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
||||
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"dequal": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@testing-library/cypress/node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/@testing-library/cypress/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/@testing-library/cypress/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/@testing-library/cypress/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/@testing-library/cypress/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/@testing-library/dom": {
|
||||
"version": "9.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz",
|
||||
|
|
@ -10014,13 +10130,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/cypress": {
|
||||
"version": "13.7.3",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-13.7.3.tgz",
|
||||
"integrity": "sha512-uoecY6FTCAuIEqLUYkTrxamDBjMHTYak/1O7jtgwboHiTnS1NaMOoR08KcTrbRZFCBvYOiS4tEkQRmsV+xcrag==",
|
||||
"version": "13.13.2",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-13.13.2.tgz",
|
||||
"integrity": "sha512-PvJQU33933NvS1StfzEb8/mu2kMy4dABwCF+yd5Bi7Qly1HOVf+Bufrygee/tlmty/6j5lX+KIi8j9Q3JUMbhA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@cypress/request": "^3.0.0",
|
||||
"@cypress/request": "^3.0.1",
|
||||
"@cypress/xvfb": "^1.2.4",
|
||||
"@types/sinonjs__fake-timers": "8.1.1",
|
||||
"@types/sizzle": "^2.3.2",
|
||||
|
|
@ -10059,7 +10175,7 @@
|
|||
"request-progress": "^3.0.0",
|
||||
"semver": "^7.5.3",
|
||||
"supports-color": "^8.1.1",
|
||||
"tmp": "~0.2.1",
|
||||
"tmp": "~0.2.3",
|
||||
"untildify": "^4.0.0",
|
||||
"yauzl": "^2.10.0"
|
||||
},
|
||||
|
|
@ -26121,15 +26237,12 @@
|
|||
"integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw=="
|
||||
},
|
||||
"node_modules/tmp": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
|
||||
"integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==",
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz",
|
||||
"integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"rimraf": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.17.0"
|
||||
"node": ">=14.14"
|
||||
}
|
||||
},
|
||||
"node_modules/tmpl": {
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@
|
|||
"@nextcloud/typings": "^1.8.0",
|
||||
"@nextcloud/webpack-vue-config": "^6.0.1",
|
||||
"@pinia/testing": "^0.1.2",
|
||||
"@testing-library/cypress": "^10.0.2",
|
||||
"@testing-library/jest-dom": "^6.1.5",
|
||||
"@testing-library/user-event": "^14.4.3",
|
||||
"@testing-library/vue": "^5.8.3",
|
||||
|
|
@ -144,7 +145,7 @@
|
|||
"babel-plugin-module-resolver": "^5.0.2",
|
||||
"colord": "^2.9.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"cypress": "^13.7.3",
|
||||
"cypress": "^13.13.2",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"cypress-if": "^1.12.3",
|
||||
"cypress-split": "^1.21.2",
|
||||
|
|
|
|||
Loading…
Reference in a new issue