Skip to content

Commit

Permalink
Merge pull request #45789 from nextcloud/fix/cy-selector
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jun 12, 2024
2 parents 003e4b9 + fea5c22 commit 0b10f2d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/files/src/views/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<template>
<NcAppSidebar v-if="file"
ref="sidebar"
cy-data-sidebar
data-cy-sidebar
v-bind="appSidebar"
:force-menu="true"
@close="close"
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/files/FilesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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) => {
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/files/files-sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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')
})

it('changes the current fileid', () => {
Expand All @@ -35,7 +35,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}`)
})

Expand All @@ -46,10 +46,10 @@ 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')

triggerActionForFile('file', 'delete')
cy.get('[cy-data-sidebar]').should('not.exist')
cy.get('[data-cy-sidebar]').should('not.exist')
})

it('changes the fileid on delete', () => {
Expand All @@ -65,11 +65,11 @@ 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.get('[data-cy-sidebar]').should('not.exist')
// Ensure the URL is changed
cy.url().should('not.contain', `apps/files/files/${otherFileId}`)
})
Expand Down
6 changes: 3 additions & 3 deletions dist/files-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

0 comments on commit 0b10f2d

Please sign in to comment.