mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-20 01:33:05 +00:00
B98 — e2e espera a cadeia após save; knip limpa exports
Atualiza campaignHomeActions para navegar ao próximo elo (votos→tendência, sinal→tendência, liderança→sinal) e remove exports de skip de votos não usados.
This commit is contained in:
parent
d8f54a5d73
commit
ca623e7aee
2 changed files with 28 additions and 13 deletions
|
|
@ -32,7 +32,7 @@ export const WIZARD_MUNICIPALITY_SEARCH_EMPTY = 'Nenhum município encontrado.'
|
||||||
|
|
||||||
export const WIZARD_VOTES_SAVED_MESSAGE = 'Votos estimados atualizados.' as const
|
export const WIZARD_VOTES_SAVED_MESSAGE = 'Votos estimados atualizados.' as const
|
||||||
|
|
||||||
export const WIZARD_VOTES_SKIP_LABEL = 'Pular ajuste de votos →' as const
|
const WIZARD_VOTES_SKIP_LABEL = 'Pular ajuste de votos →' as const
|
||||||
|
|
||||||
export const WIZARD_VOTES_FINAL_CTA_LABEL = 'Salvar estimativas →' as const
|
export const WIZARD_VOTES_FINAL_CTA_LABEL = 'Salvar estimativas →' as const
|
||||||
|
|
||||||
|
|
@ -43,9 +43,8 @@ export type WizardVotesSkipAction = {
|
||||||
href: string
|
href: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const shouldShowWizardVotesSkip = (
|
const shouldShowWizardVotesSkip = (entryAction: CampaignWizardActionId | undefined): boolean =>
|
||||||
entryAction: CampaignWizardActionId | undefined,
|
entryAction != null && entryAction !== 'update-votes'
|
||||||
): boolean => entryAction != null && entryAction !== 'update-votes'
|
|
||||||
|
|
||||||
export const resolveWizardVotesSkip = (
|
export const resolveWizardVotesSkip = (
|
||||||
entryAction: CampaignWizardActionId | undefined,
|
entryAction: CampaignWizardActionId | undefined,
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,11 @@ test.describe('Wizard — ajuste de votos (B61 / B77)', () => {
|
||||||
await step.getByRole('textbox', { name: 'Otimista' }).fill('350')
|
await step.getByRole('textbox', { name: 'Otimista' }).fill('350')
|
||||||
await page.getByRole('button', { name: 'Salvar estimativas →' }).click()
|
await page.getByRole('button', { name: 'Salvar estimativas →' }).click()
|
||||||
|
|
||||||
|
await page.waitForURL(
|
||||||
|
new RegExp(
|
||||||
|
`/campanha/acoes/mudar-tendencia\\?municipio=${municipality.slug}&entry=update-votes`,
|
||||||
|
),
|
||||||
|
)
|
||||||
await expect(page.getByText('Votos estimados atualizados.')).toBeVisible({ timeout: 15000 })
|
await expect(page.getByText('Votos estimados atualizados.')).toBeVisible({ timeout: 15000 })
|
||||||
expect(page.url()).not.toContain('cenario=')
|
expect(page.url()).not.toContain('cenario=')
|
||||||
})
|
})
|
||||||
|
|
@ -273,7 +278,7 @@ test.describe('Wizard — ajuste de votos (B61 / B77)', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Wizard — atualizar liderança (B70)', () => {
|
test.describe('Wizard — atualizar liderança (B70)', () => {
|
||||||
test('create leadership, save, and continue to home', async ({ campaign, page }) => {
|
test('create leadership, save, and continue into the chain', async ({ campaign, page }) => {
|
||||||
const { fixtures } = campaign
|
const { fixtures } = campaign
|
||||||
const coordinator = await fixtures.createCampaignUser('coordinator', {
|
const coordinator = await fixtures.createCampaignUser('coordinator', {
|
||||||
name: fixtures.value('Coordenadora Geral'),
|
name: fixtures.value('Coordenadora Geral'),
|
||||||
|
|
@ -301,13 +306,17 @@ test.describe('Wizard — atualizar liderança (B70)', () => {
|
||||||
await expect(page.getByRole('button', { name: 'Continuar' })).toBeVisible()
|
await expect(page.getByRole('button', { name: 'Continuar' })).toBeVisible()
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Continuar' }).click()
|
await page.getByRole('button', { name: 'Continuar' }).click()
|
||||||
await page.waitForURL('/campanha')
|
await page.waitForURL(
|
||||||
await expect(page.getByLabel('Buscar na campanha')).toBeVisible()
|
new RegExp(
|
||||||
|
`/campanha/acoes/registrar-sinal\\?municipio=${municipality.slug}&entry=update-leadership`,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
await expect(page.getByRole('heading', { name: 'Que tipo de sinal?' })).toBeVisible()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Wizard — registrar sinal (B63)', () => {
|
test.describe('Wizard — registrar sinal (B63)', () => {
|
||||||
test('standalone flow: type grid, body step, save returns to Início', async ({
|
test('standalone flow: type grid, body step, save continues the chain', async ({
|
||||||
campaign,
|
campaign,
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
@ -335,7 +344,11 @@ test.describe('Wizard — registrar sinal (B63)', () => {
|
||||||
await body.fill('Adversário marcou presença no centro do município.')
|
await body.fill('Adversário marcou presença no centro do município.')
|
||||||
await page.getByRole('button', { name: 'Salvar' }).click()
|
await page.getByRole('button', { name: 'Salvar' }).click()
|
||||||
|
|
||||||
await page.waitForURL(/\/campanha$/)
|
await page.waitForURL(
|
||||||
|
new RegExp(
|
||||||
|
`/campanha/acoes/mudar-tendencia\\?municipio=${municipality.slug}&entry=register-signal`,
|
||||||
|
),
|
||||||
|
)
|
||||||
await expect(page.getByText('Sinal registrado.')).toBeVisible()
|
await expect(page.getByText('Sinal registrado.')).toBeVisible()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -362,7 +375,7 @@ test.describe('Wizard — registrar sinal (B63)', () => {
|
||||||
await expect(page.getByRole('dialog')).toHaveCount(0)
|
await expect(page.getByRole('dialog')).toHaveCount(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('embedded flow shows skip link', async ({ campaign, page }) => {
|
test('embedded flow shows skip link to the next chain step', async ({ campaign, page }) => {
|
||||||
const { fixtures } = campaign
|
const { fixtures } = campaign
|
||||||
const coordinator = await fixtures.createCampaignUser('coordinator', {
|
const coordinator = await fixtures.createCampaignUser('coordinator', {
|
||||||
name: fixtures.value('Coordenadora Geral'),
|
name: fixtures.value('Coordenadora Geral'),
|
||||||
|
|
@ -374,8 +387,11 @@ test.describe('Wizard — registrar sinal (B63)', () => {
|
||||||
`/campanha/acoes/registrar-sinal?municipio=${municipality.slug}&entry=update-votes`,
|
`/campanha/acoes/registrar-sinal?municipio=${municipality.slug}&entry=update-votes`,
|
||||||
)
|
)
|
||||||
|
|
||||||
await expect(page.getByRole('link', { name: 'Pular registro de sinal' })).toBeVisible({
|
const skip = page.getByRole('link', { name: 'Pular registro de sinal' })
|
||||||
timeout: 15000,
|
await expect(skip).toBeVisible({ timeout: 15000 })
|
||||||
})
|
await expect(skip).toHaveAttribute(
|
||||||
|
'href',
|
||||||
|
`/campanha/acoes/atualizar-lideranca?municipio=${municipality.slug}&entry=update-votes`,
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue