aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-02-06 01:55:40 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-02-06 01:55:40 +0100
commit0e96fb67c54167688fc6304284e05dec0f0f7528 (patch)
tree29b31432590b2155d6e57055038c544d1fa1e045
parent6b0f9425a784cd1f79e78159126f682f6c3db994 (diff)
downloadnextcloud-server-fix/files-show-details-when-no-action.tar.gz
nextcloud-server-fix/files-show-details-when-no-action.zip
fixup! fix(files): Do not download files with `openfile` query flagfix/files-show-details-when-no-action
-rw-r--r--cypress/e2e/files/router-query.cy.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/cypress/e2e/files/router-query.cy.ts b/cypress/e2e/files/router-query.cy.ts
index 5a7e50e393d..9c6564c8ecf 100644
--- a/cypress/e2e/files/router-query.cy.ts
+++ b/cypress/e2e/files/router-query.cy.ts
@@ -19,16 +19,16 @@ function sidebarIsOpen(name: string): void {
}
/**
- * @param callback Callback if viewer is disabled (`this.skip`)
+ * Skip a test without viewer installed
*/
-function skipIfViewerDisabled(callback: () => void) {
- return cy.runOccCommand('app:list --enabled --output json')
+function skipIfViewerDisabled(this: Mocha.Context): void {
+ cy.runOccCommand('app:list --enabled --output json')
.then((exec) => exec.stdout)
.then((output) => JSON.parse(output))
.then((obj) => 'viewer' in obj.enabled)
.then((enabled) => {
if (!enabled) {
- callback()
+ this.skip()
}
})
}
@@ -115,21 +115,21 @@ describe('Check router query flags:', function() {
}
it('opens files with default action', function() {
- skipIfViewerDisabled(this.skip)
+ skipIfViewerDisabled.call(this)
cy.visit(`/apps/files/files/${imageId}?openfile`)
viewerShowsImage()
})
it('opens files with default action using explicit query state', function() {
- skipIfViewerDisabled(this.skip)
+ skipIfViewerDisabled.call(this)
cy.visit(`/apps/files/files/${imageId}?openfile=true`)
viewerShowsImage()
})
it('does not open files with default action when using explicitly query value `false`', function() {
- skipIfViewerDisabled(this.skip)
+ skipIfViewerDisabled.call(this)
cy.visit(`/apps/files/files/${imageId}?openfile=false`)
getRowForFileId(imageId)