66import { beforeEach , describe , expect , it , vi } from 'vitest'
77import { mount } from '@vue/test-utils'
88
9+ import { initialActionCode , ACTION_CODES } from '../helpers/ActionMapping'
10+
911type 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