-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[stable29] fix(files_trashbin): disable bulk download for trashbin #51208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+282
−98
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d417f41
fix(files_trashbin): disable bulk download for trashbin
susnux 8887261
test: fix CI when running Karma tests
susnux c5ad89a
test(cypress): wait for button to be visible
susnux 2b03f79
chore(assets): Recompile assets
nextcloud-command bec5671
test(cypress): adjust files-renaming
susnux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /*! | ||
| * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| import type { User } from '@nextcloud/cypress' | ||
|
|
||
| // @ts-expect-error package has wrong typings | ||
| import { deleteDownloadsFolderBeforeEach } from 'cypress-delete-downloads-folder' | ||
| import { deleteFileWithRequest, getRowForFileId, selectAllFiles, triggerActionForFileId } from '../files/FilesUtils.ts' | ||
|
|
||
| describe('files_trashbin: download files', { testIsolation: true }, () => { | ||
| let user: User | ||
| const fileids: number[] = [] | ||
|
|
||
| deleteDownloadsFolderBeforeEach() | ||
|
|
||
| before(() => { | ||
| cy.createRandomUser().then(($user) => { | ||
| user = $user | ||
|
|
||
| cy.uploadContent(user, new Blob(['<content>']), 'text/plain', '/file.txt') | ||
| .then(({ headers }) => fileids.push(Number.parseInt(headers['oc-fileid']))) | ||
| .then(() => deleteFileWithRequest(user, '/file.txt')) | ||
| cy.uploadContent(user, new Blob(['<content>']), 'text/plain', '/other-file.txt') | ||
| .then(({ headers }) => fileids.push(Number.parseInt(headers['oc-fileid']))) | ||
| .then(() => deleteFileWithRequest(user, '/other-file.txt')) | ||
| }) | ||
| }) | ||
|
|
||
| beforeEach(() => { | ||
| cy.login(user) | ||
| cy.visit('/apps/files/trashbin') | ||
| }) | ||
|
|
||
| it('can download file', () => { | ||
| getRowForFileId(fileids[0]).should('be.visible') | ||
| getRowForFileId(fileids[1]).should('be.visible') | ||
|
|
||
| triggerActionForFileId(fileids[0], 'download') | ||
|
|
||
| const downloadsFolder = Cypress.config('downloadsFolder') | ||
| cy.readFile(`${downloadsFolder}/file.txt`, { timeout: 15000 }) | ||
| .should('exist') | ||
| .and('have.length.gt', 8) | ||
| .and('equal', '<content>') | ||
| }) | ||
|
|
||
| it('can download a file using default action', () => { | ||
| getRowForFileId(fileids[0]) | ||
| .should('be.visible') | ||
| .findByRole('button', { name: 'Download' }) | ||
| .click({ force: true }) | ||
|
|
||
| const downloadsFolder = Cypress.config('downloadsFolder') | ||
| cy.readFile(`${downloadsFolder}/file.txt`, { timeout: 15000 }) | ||
| .should('exist') | ||
| .and('have.length.gt', 8) | ||
| .and('equal', '<content>') | ||
| }) | ||
|
|
||
| // TODO: Fix this as this dependens on the webdav zip folder plugin not working for trashbin (and never worked with old NC legacy download ajax as well) | ||
| it('does not offer bulk download', () => { | ||
| cy.get('[data-cy-files-list-row-checkbox]').should('have.length', 2) | ||
| selectAllFiles() | ||
| cy.get('.files-list__selected').should('have.text', '2 selected') | ||
| cy.get('[data-cy-files-list-selection-action="restore"]').should('be.visible') | ||
| cy.get('[data-cy-files-list-selection-action="download"]').should('not.exist') | ||
| }) | ||
| }) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.