diff options
Diffstat (limited to 'apps/files/src')
-rw-r--r-- | apps/files/src/actions/editLocallyAction.spec.ts | 6 | ||||
-rw-r--r-- | apps/files/src/actions/openFolderAction.spec.ts | 5 | ||||
-rw-r--r-- | apps/files/src/actions/sidebarAction.ts | 1 | ||||
-rw-r--r-- | apps/files/src/components/SidebarTab.vue | 1 | ||||
-rw-r--r-- | apps/files/src/services/RouterService.ts | 14 | ||||
-rw-r--r-- | apps/files/src/views/Navigation.cy.ts | 2 |
6 files changed, 13 insertions, 16 deletions
diff --git a/apps/files/src/actions/editLocallyAction.spec.ts b/apps/files/src/actions/editLocallyAction.spec.ts index 93315c5a016..3582c0d9138 100644 --- a/apps/files/src/actions/editLocallyAction.spec.ts +++ b/apps/files/src/actions/editLocallyAction.spec.ts @@ -21,11 +21,11 @@ */ import { action } from './editLocallyAction' import { expect } from '@jest/globals' -import { File, Folder, Permission } from '@nextcloud/files' +import { File, Permission } from '@nextcloud/files' import { FileAction } from '../services/FileAction' +import * as ncDialogs from '@nextcloud/dialogs' import axios from '@nextcloud/axios' import type { Navigation } from '../services/Navigation' -import ncDialogs from '@nextcloud/dialogs' const view = { id: 'files', @@ -140,7 +140,7 @@ describe('Edit locally action execute tests', () => { test('Edit locally fails and show error', async () => { jest.spyOn(axios, 'post').mockImplementation(async () => ({})) - jest.spyOn(ncDialogs, 'showError') + jest.spyOn(ncDialogs, 'showError').mockImplementation(async () => ({})) const file = new File({ id: 1, diff --git a/apps/files/src/actions/openFolderAction.spec.ts b/apps/files/src/actions/openFolderAction.spec.ts index 07502be2eed..140b6722608 100644 --- a/apps/files/src/actions/openFolderAction.spec.ts +++ b/apps/files/src/actions/openFolderAction.spec.ts @@ -21,7 +21,7 @@ */ import { action } from './openFolderAction' import { expect } from '@jest/globals' -import { File, Folder, Permission } from '@nextcloud/files' +import { File, Folder, Node, Permission } from '@nextcloud/files' import { FileAction } from '../services/FileAction' import type { Navigation } from '../services/Navigation' @@ -139,8 +139,7 @@ describe('Open folder action execute tests', () => { const goToRouteMock = jest.fn() window.OCP = { Files: { Router: { goToRoute: goToRouteMock } } } - // @ts-ignore null as Node - const exec = await action.exec(null, view, '/') + const exec = await action.exec(null as unknown as Node, view, '/') expect(exec).toBe(false) expect(goToRouteMock).toBeCalledTimes(0) }) diff --git a/apps/files/src/actions/sidebarAction.ts b/apps/files/src/actions/sidebarAction.ts index d0baf611992..4766d2e90df 100644 --- a/apps/files/src/actions/sidebarAction.ts +++ b/apps/files/src/actions/sidebarAction.ts @@ -65,4 +65,3 @@ export const action = new FileAction({ }) registerFileAction(action) - diff --git a/apps/files/src/components/SidebarTab.vue b/apps/files/src/components/SidebarTab.vue index 0a6432b47b6..78c050048f1 100644 --- a/apps/files/src/components/SidebarTab.vue +++ b/apps/files/src/components/SidebarTab.vue @@ -1,4 +1,3 @@ - <!-- - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com> - diff --git a/apps/files/src/services/RouterService.ts b/apps/files/src/services/RouterService.ts index 978e009514e..55033f9c79c 100644 --- a/apps/files/src/services/RouterService.ts +++ b/apps/files/src/services/RouterService.ts @@ -19,14 +19,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -import type { Route } from 'vue-router'; -import type VueRouter from 'vue-router'; -import type { Dictionary } from 'vue-router/types/router'; -import type { Location } from 'vue-router/types/router'; +import type { Route } from 'vue-router' +import type VueRouter from 'vue-router' +import type { Dictionary, Location } from 'vue-router/types/router' export default class RouterService { - private _router: VueRouter; + private _router: VueRouter constructor(router: VueRouter) { this._router = router @@ -34,12 +33,12 @@ export default class RouterService { /** * Trigger a route change on the files app - * + * * @param path the url path, eg: '/trashbin?dir=/Deleted' * @param replace replace the current history * @see https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location */ - goTo(path: string, replace: boolean = false): Promise<Route> { + goTo(path: string, replace = false): Promise<Route> { return this._router.push({ path, replace, @@ -68,4 +67,5 @@ export default class RouterService { replace, } as Location) } + } diff --git a/apps/files/src/views/Navigation.cy.ts b/apps/files/src/views/Navigation.cy.ts index c9a7ca98ee1..97f1f8ee7b8 100644 --- a/apps/files/src/views/Navigation.cy.ts +++ b/apps/files/src/views/Navigation.cy.ts @@ -161,7 +161,7 @@ describe('Quota rendering', () => { // TODO: remove when @nextcloud/l10n 2.0 is released // https://github.com/nextcloud/nextcloud-l10n/pull/542 cy.stub(L10n, 'translate', (app, text, vars = {}, number) => { - cy.log({app, text, vars, number}) + cy.log({ app, text, vars, number }) return text.replace(/%n/g, '' + number).replace(/{([^{}]*)}/g, (match, key) => { return vars[key] }) |