fix(Cypress): Adjust tests for new breadcrumbs

Signed-off-by: Eduardo Morales <emoral435@gmail.com>
pull/44450/head
Eduardo Morales 1 month ago committed by Ferdinand Thiessen
parent f6b1fd41c9
commit 0213fb6b5d
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400

@ -166,7 +166,7 @@ export default defineComponent({
return this.filesStore.getNode(id)
},
getFileIdFromPath(path: string): number | undefined {
return this.pathsStore.getPath(this.currentView!.id, path)
return this.pathsStore.getPath(this.currentView?.id, path)
},
getDirDisplayName(path: string): string {
if (path === '/') {

@ -133,7 +133,7 @@ export const closeSidebar = () => {
cy.get('[cy-data-sidebar] .app-sidebar__close').click({ force: true })
}
export const clickOnBreadcumbs = (label: string) => {
export const clickOnBreadcrumbs = (label: string) => {
cy.intercept('PROPFIND', /\/remote.php\/dav\//).as('propfind')
cy.get('[data-cy-files-content-breadcrumbs]').contains(label).click()
cy.wait('@propfind')

@ -21,7 +21,7 @@
*/
import type { User } from '@nextcloud/cypress'
import { clickOnBreadcumbs, closeSidebar, copyFile, getRowForFile, getRowForFileId, renameFile, triggerActionForFile, triggerInlineActionForFileId } from './FilesUtils'
import { clickOnBreadcrumbs, closeSidebar, copyFile, getRowForFile, getRowForFileId, renameFile, triggerActionForFile, triggerInlineActionForFileId } from './FilesUtils'
/**
*
@ -113,7 +113,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
it('Copies both files when copying the .jpg', () => {
copyFile(`${randomFileName}.jpg`, '.')
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
getRowForFile(`${randomFileName}.jpg`).should('have.length', 1)
getRowForFile(`${randomFileName}.mov`).should('have.length', 1)
@ -123,7 +123,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
it('Copies both files when copying the .mov', () => {
copyFile(`${randomFileName}.mov`, '.')
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
getRowForFile(`${randomFileName}.mov`).should('have.length', 1)
getRowForFile(`${randomFileName} (copy).jpg`).should('have.length', 1)
@ -132,7 +132,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
it('Moves files when moving the .jpg', () => {
renameFile(`${randomFileName}.jpg`, `${randomFileName}_moved.jpg`)
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
getRowForFileId(jpgFileId).invoke('attr', 'data-cy-files-list-row-name').should('equal', `${randomFileName}_moved.jpg`)
getRowForFileId(movFileId).invoke('attr', 'data-cy-files-list-row-name').should('equal', `${randomFileName}_moved.mov`)
@ -140,7 +140,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
it('Moves files when moving the .mov', () => {
renameFile(`${randomFileName}.mov`, `${randomFileName}_moved.mov`)
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
getRowForFileId(jpgFileId).invoke('attr', 'data-cy-files-list-row-name').should('equal', `${randomFileName}_moved.jpg`)
getRowForFileId(movFileId).invoke('attr', 'data-cy-files-list-row-name').should('equal', `${randomFileName}_moved.mov`)
@ -148,7 +148,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
it('Deletes files when deleting the .jpg', () => {
triggerActionForFile(`${randomFileName}.jpg`, 'delete')
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
getRowForFile(`${randomFileName}.jpg`).should('have.length', 0)
getRowForFile(`${randomFileName}.mov`).should('have.length', 0)
@ -161,7 +161,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
it('Block deletion when deleting the .mov', () => {
triggerActionForFile(`${randomFileName}.mov`, 'delete')
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
getRowForFile(`${randomFileName}.jpg`).should('have.length', 1)
getRowForFile(`${randomFileName}.mov`).should('have.length', 1)
@ -176,7 +176,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
triggerActionForFile(`${randomFileName}.jpg`, 'delete')
cy.visit('/apps/files/trashbin')
triggerInlineActionForFileId(jpgFileId, 'restore')
clickOnBreadcumbs('Deleted files')
clickOnBreadcrumbs('Deleted files')
getRowForFile(`${randomFileName}.jpg`).should('have.length', 0)
getRowForFile(`${randomFileName}.mov`).should('have.length', 0)
@ -191,7 +191,7 @@ describe('Files: Live photos', { testIsolation: true }, () => {
triggerActionForFile(`${randomFileName}.jpg`, 'delete')
cy.visit('/apps/files/trashbin')
triggerInlineActionForFileId(movFileId, 'restore')
clickOnBreadcumbs('Deleted files')
clickOnBreadcrumbs('Deleted files')
getRowForFileId(jpgFileId).should('have.length', 1)
getRowForFileId(movFileId).should('have.length', 1)

@ -21,7 +21,7 @@
*/
import { assertVersionContent, openVersionsPanel, setupTestSharedFileFromUser, uploadThreeVersions, nameVersion } from './filesVersionsUtils'
import { clickOnBreadcumbs, closeSidebar, copyFile, moveFile, navigateToFolder } from '../files/FilesUtils'
import { clickOnBreadcrumbs, closeSidebar, copyFile, moveFile, navigateToFolder } from '../files/FilesUtils'
import type { User } from '@nextcloud/cypress'
/**
@ -31,7 +31,7 @@ import type { User } from '@nextcloud/cypress'
function assertVersionsContent(filePath: string) {
const path = filePath.split('/').slice(0, -1).join('/')
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
if (path !== '') {
navigateToFolder(path)
@ -96,7 +96,7 @@ describe('Versions cross share move and copy', () => {
beforeEach(() => {
randomSubFolderName = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(0, 10)
randomSubSubFolderName = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(0, 10)
clickOnBreadcumbs('All files')
clickOnBreadcrumbs('All files')
cy.mkdir(bob, `/${randomSharedFolderName}/${randomSubFolderName}`)
cy.mkdir(bob, `/${randomSharedFolderName}/${randomSubFolderName}/${randomSubSubFolderName}`)
cy.login(bob)

Loading…
Cancel
Save