Browse Source
Merge pull request #53285 from nextcloud/fix/files-position-navigation
pull/53314/head
Merge pull request #53285 from nextcloud/fix/files-position-navigation
pull/53314/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 120 additions and 3 deletions
-
62apps/files/src/router/router.ts
-
55cypress/e2e/files/files-navigation.cy.ts
-
4dist/files-main.js
-
2dist/files-main.js.map
@ -0,0 +1,55 @@ |
|||
/*! |
|||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
|
|||
import type { User } from '@nextcloud/cypress' |
|||
import { getRowForFile, navigateToFolder } from './FilesUtils.ts' |
|||
|
|||
describe('files: Navigate through folders and observe behavior', () => { |
|||
let user: User |
|||
|
|||
before(() => { |
|||
cy.createRandomUser().then(($user) => { |
|||
user = $user |
|||
cy.mkdir(user, '/foo') |
|||
cy.mkdir(user, '/foo/bar') |
|||
cy.mkdir(user, '/foo/bar/baz') |
|||
}) |
|||
}) |
|||
|
|||
it('Shows root folder and we can navigate to the last folder', () => { |
|||
cy.login(user) |
|||
cy.visit('/apps/files/') |
|||
|
|||
getRowForFile('foo').should('be.visible') |
|||
navigateToFolder('/foo/bar/baz') |
|||
|
|||
// Last folder is empty
|
|||
cy.get('[data-cy-files-list-row-fileid]').should('not.exist') |
|||
}) |
|||
|
|||
it('Highlight the previous folder when navigating back', () => { |
|||
cy.go('back') |
|||
getRowForFile('baz').should('be.visible') |
|||
.invoke('attr', 'class').should('contain', 'active') |
|||
|
|||
cy.go('back') |
|||
getRowForFile('bar').should('be.visible') |
|||
.invoke('attr', 'class').should('contain', 'active') |
|||
|
|||
cy.go('back') |
|||
getRowForFile('foo').should('be.visible') |
|||
.invoke('attr', 'class').should('contain', 'active') |
|||
}) |
|||
|
|||
it('Can navigate forward again', () => { |
|||
cy.go('forward') |
|||
getRowForFile('bar').should('be.visible') |
|||
.invoke('attr', 'class').should('contain', 'active') |
|||
|
|||
cy.go('forward') |
|||
getRowForFile('baz').should('be.visible') |
|||
.invoke('attr', 'class').should('contain', 'active') |
|||
}) |
|||
}) |
|||
4
dist/files-main.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
dist/files-main.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue