32 lines
869 B
TypeScript
32 lines
869 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { shouldShowIntroSplash } from '../introSplash'
|
|
|
|
describe('shouldShowIntroSplash', () => {
|
|
it('skips intro on an already-onboarded node even without a browser intro flag', () => {
|
|
expect(shouldShowIntroSplash({
|
|
seenIntro: false,
|
|
routePath: '/',
|
|
fromBoot: false,
|
|
onboardingComplete: true,
|
|
})).toBe(false)
|
|
})
|
|
|
|
it('shows intro for a fresh root visit when onboarding is not complete', () => {
|
|
expect(shouldShowIntroSplash({
|
|
seenIntro: false,
|
|
routePath: '/',
|
|
fromBoot: false,
|
|
onboardingComplete: false,
|
|
})).toBe(true)
|
|
})
|
|
|
|
it('does not interrupt direct routes', () => {
|
|
expect(shouldShowIntroSplash({
|
|
seenIntro: false,
|
|
routePath: '/dashboard/web5',
|
|
fromBoot: false,
|
|
onboardingComplete: null,
|
|
})).toBe(false)
|
|
})
|
|
})
|