Skip to content

Commit fae22c0

Browse files
test(vue3): adapt FileEntryActions spec for script setup
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 986d223 commit fae22c0

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/tests/views/FilesList/FileEntryActions.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ const signStoreMock = {
4848

4949
const routerPushMock = vi.fn()
5050

51+
vi.mock('vue-router', () => ({
52+
useRouter: vi.fn(() => ({
53+
push: routerPushMock,
54+
})),
55+
}))
56+
5157
vi.mock('@nextcloud/l10n', () => ({
5258
t: vi.fn((_app: string, text: string) => text),
5359
}))
@@ -147,13 +153,6 @@ describe('FileEntryActions.vue', () => {
147153
source,
148154
loading: false,
149155
},
150-
global: {
151-
mocks: {
152-
$router: {
153-
push: routerPushMock,
154-
},
155-
},
156-
},
157156
})
158157

159158
beforeEach(() => {
@@ -255,4 +254,4 @@ describe('FileEntryActions.vue', () => {
255254
expect(filesStoreMock.delete).toHaveBeenCalledWith(source, false)
256255
expect(wrapper.vm.deleting).toBe(false)
257256
})
258-
})
257+
})

0 commit comments

Comments
 (0)