Skip to content

Commit

Permalink
add spec for default redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
frontendphil committed Dec 13, 2024
1 parent cd88686 commit d1472e4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions extension/src/panel/pages/_index/NoRoutes.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { saveLastUsedRouteId } from '@/execution-routes'
import { expectRouteToBe, render } from '@/test-utils'
import { describe, it } from 'vitest'
import { action, loader, NoRoutes } from './NoRoutes'

describe('No routes', () => {
describe('Default redirects', () => {
it('redirects to the last used route if one is present', async () => {
await saveLastUsedRouteId('test-route')

await render('/', [{ path: '/', Component: NoRoutes, loader, action }], {
inspectRoutes: ['/:activeRouteId'],
})

await expectRouteToBe('/test-route')
})
})
})

0 comments on commit d1472e4

Please sign in to comment.