Files
accounted/lib/onboarding-journey/__tests__/branch.test.ts
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

38 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { BRANCH_PROVIDERS, branchDestination, type BranchChoice } from '../branch'
describe('branchDestination', () => {
it.each(['fortnox', 'visma', 'bokio', 'bjornlunden', 'briox'] as const)(
'routes %s into the migration wizard with the provider preselected',
(provider) => {
expect(branchDestination(provider)).toEqual({
path: 'migration',
href: `/import?mode=migration&provider=${provider}`,
})
}
)
it('routes the SIE file straight to the upload step', () => {
expect(branchDestination('sie')).toEqual({ path: 'migration', href: '/import?mode=sie' })
})
it('marks a new business as fresh and lands on Hem', () => {
expect(branchDestination('fresh')).toEqual({ path: 'fresh', href: '/' })
})
it('persists nothing on a pure skip', () => {
expect(branchDestination('skip')).toEqual({ path: null, href: '/' })
})
it('keeps provider chips aligned with the routable choices', () => {
const choices = new Set<BranchChoice>(BRANCH_PROVIDERS.map((p) => p.id))
for (const id of choices) {
expect(branchDestination(id).path).toBe('migration')
}
// Every provider entry carries a real logo path under /logos/.
for (const p of BRANCH_PROVIDERS) {
expect(p.logo.startsWith('/logos/')).toBe(true)
}
})
})