mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 23:53:05 +00:00
Após salvar (ou Pular) votos/tendência/sinal/liderança, navega ao próximo elo da matriz v1 no mesmo município via entryAction, em vez de voltar ao Início. Helper puro wizardActionChain + skips alinhados. Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { CAMPAIGN_HOME } from '@/lib/campaignPaths'
|
|
import { WIZARD_LEADERSHIP_SKIP_LABEL } from '@/lib/campaignWizardCopy'
|
|
import {
|
|
resolveWizardLeadershipSkip,
|
|
showLeadershipWizardSkip,
|
|
} from '@/lib/wizardLeadershipContract'
|
|
|
|
describe('showLeadershipWizardSkip', () => {
|
|
it('hides skip for standalone entry (implicit update-leadership)', () => {
|
|
expect(showLeadershipWizardSkip(undefined)).toBe(false)
|
|
})
|
|
|
|
it('hides skip when entry is update-leadership', () => {
|
|
expect(showLeadershipWizardSkip('update-leadership')).toBe(false)
|
|
})
|
|
|
|
it('shows skip when embedded from another wizard action', () => {
|
|
expect(showLeadershipWizardSkip('update-votes')).toBe(true)
|
|
})
|
|
})
|
|
|
|
describe('resolveWizardLeadershipSkip', () => {
|
|
it('returns undefined for standalone entry', () => {
|
|
expect(resolveWizardLeadershipSkip(undefined, 'cairu')).toBeUndefined()
|
|
expect(resolveWizardLeadershipSkip('update-leadership', 'cairu')).toBeUndefined()
|
|
})
|
|
|
|
it('points skip to Início when leadership is the last chained step', () => {
|
|
// In the v1 matrix, leadership is always the final chained elo.
|
|
expect(resolveWizardLeadershipSkip('update-votes', 'cairu')).toEqual({
|
|
label: WIZARD_LEADERSHIP_SKIP_LABEL,
|
|
href: CAMPAIGN_HOME,
|
|
})
|
|
})
|
|
})
|