|
2 | 2 | * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors |
3 | 3 | * SPDX-License-Identifier: AGPL-3.0-or-later |
4 | 4 | */ |
5 | | -import { File, Permission, View } from '@nextcloud/files' |
| 5 | +import { File, Folder, Permission, View } from '@nextcloud/files' |
6 | 6 | import { describe, it, vi, expect, beforeEach, beforeAll, afterEach } from 'vitest' |
7 | 7 | import { nextTick } from 'vue' |
8 | 8 | import axios from '@nextcloud/axios' |
9 | 9 |
|
10 | 10 | import { getPinia } from '../store/index.ts' |
11 | 11 | import { useActiveStore } from '../store/active.ts' |
| 12 | +import { useFilesStore } from '../store/files' |
12 | 13 |
|
13 | 14 | import { action as deleteAction } from '../actions/deleteAction.ts' |
14 | 15 | import { action as favoriteAction } from '../actions/favoriteAction.ts' |
@@ -49,13 +50,17 @@ describe('HotKeysService testing', () => { |
49 | 50 |
|
50 | 51 | // Make sure the file is reset before each test |
51 | 52 | file = new File({ |
52 | | - id: 1, |
| 53 | + id: 2, |
53 | 54 | source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt', |
54 | 55 | owner: 'admin', |
55 | 56 | mime: 'text/plain', |
56 | 57 | permissions: Permission.ALL, |
57 | 58 | }) |
58 | 59 |
|
| 60 | + const root = new Folder({ owner: 'test', source: 'https://cloud.domain.com/remote.php/dav/files/admin/', id: 1, permissions: Permission.CREATE }) |
| 61 | + const files = useFilesStore(getPinia()) |
| 62 | + files.setRoot({ service: 'files', root }) |
| 63 | + |
59 | 64 | // Setting the view first as it reset the active node |
60 | 65 | activeStore.activeView = view |
61 | 66 | activeStore.activeNode = file |
|
0 commit comments