Skip to content

Commit 42472fe

Browse files
test(app): use initialActionCode ref instead of route.params in isDoNothingError tests
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 63a8570 commit 42472fe

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/tests/App.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import { beforeEach, describe, expect, it, vi } from 'vitest'
77
import { mount } from '@vue/test-utils'
88

9+
import { initialActionCode, ACTION_CODES } from '../helpers/ActionMapping'
10+
911
type RouteState = {
1012
path: string
1113
name: string | undefined
@@ -56,6 +58,7 @@ describe('App', () => {
5658
routeState.name = 'fileslist'
5759
routeState.params = {}
5860
routeState.matched = []
61+
initialActionCode.value = 0
5962
})
6063

6164
it('shows left sidebar on regular internal routes', () => {
@@ -182,8 +185,8 @@ describe('App', () => {
182185
expect(wrapper.find('.nc-content').classes()).not.toContain('sign-external-page')
183186
})
184187

185-
it('shows DefaultPageError when action param is 2000', () => {
186-
routeState.params = { action: 2000 }
188+
it('shows DefaultPageError when initial action code is DO_NOTHING (2000)', () => {
189+
initialActionCode.value = ACTION_CODES.DO_NOTHING
187190

188191
const wrapper = mount(App, {
189192
global: {
@@ -203,7 +206,7 @@ describe('App', () => {
203206
})
204207

205208
it('does not show DefaultPageError on normal routes', () => {
206-
routeState.params = {}
209+
// initialActionCode is already 0 (reset in beforeEach)
207210

208211
const wrapper = mount(App, {
209212
global: {

0 commit comments

Comments
 (0)