diff options
-rw-r--r-- | cypress/e2e/files/router-query.cy.ts | 14 |
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) |