mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-20 18:24:45 +00:00
Fix e2e failures from FAB chrome waits and B27 advisor strict-mode.
B126 mobile specs looked for a page heading that shell chrome replaced; wait on campaignPageChrome with exact title text, and wrap the desktop title so subtitle no longer collides. Pin B27 to the município-specific assessores trigger and map home-search libs to campaignMunicipalities.
This commit is contained in:
parent
7a0c4376eb
commit
0baeda22a0
2 changed files with 26 additions and 3 deletions
|
|
@ -79,8 +79,14 @@ export const E2E_AFFECTED_MANIFEST = [
|
||||||
'src/utilities/campaignDashboardData',
|
'src/utilities/campaignDashboardData',
|
||||||
'src/lib/campaignHomeSearchHits',
|
'src/lib/campaignHomeSearchHits',
|
||||||
'src/lib/homeSearchShare',
|
'src/lib/homeSearchShare',
|
||||||
|
'src/lib/homeSearchExcludeCurrentEntity',
|
||||||
|
'src/lib/homeSearchNearestMunicipalityMerge',
|
||||||
|
'src/lib/homeSearchSuggest',
|
||||||
|
'src/lib/homeSearchUi',
|
||||||
],
|
],
|
||||||
specs: ['campaignHomeActions'],
|
// Home search suggest/exclude is exercised on municipality detail (B109)
|
||||||
|
// as well as the home action suite.
|
||||||
|
specs: ['campaignHomeActions', 'campaignMunicipalities'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prefixes: [
|
prefixes: [
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,11 @@ test.describe('Municípios — jornadas por papel', () => {
|
||||||
)
|
)
|
||||||
await expect(campaignPageChrome(page, 'Municípios')).toBeVisible()
|
await expect(campaignPageChrome(page, 'Municípios')).toBeVisible()
|
||||||
|
|
||||||
const advisorsTrigger = page.getByRole('button', { name: 'Editar assessores' }).first()
|
// Name includes the município — a substring search can return neighbors
|
||||||
|
// (strict-mode flake when two "Editar assessores …" buttons match).
|
||||||
|
const advisorsTrigger = page.getByRole('button', {
|
||||||
|
name: `Editar assessores em ${municipality.name}`,
|
||||||
|
})
|
||||||
await advisorsTrigger.click()
|
await advisorsTrigger.click()
|
||||||
|
|
||||||
const advisorsPopover = page.locator('[data-slot="popover-content"]')
|
const advisorsPopover = page.locator('[data-slot="popover-content"]')
|
||||||
|
|
@ -119,12 +123,24 @@ test.describe('Municípios — jornadas por papel', () => {
|
||||||
|
|
||||||
// The popover stays open after the write (auto-save, not submit+close).
|
// The popover stays open after the write (auto-save, not submit+close).
|
||||||
await expect(advisorsPopover).toBeVisible()
|
await expect(advisorsPopover).toBeVisible()
|
||||||
|
// Trigger label flips from "sem assessor" only after the write lands —
|
||||||
|
// wait for that before Escape/reload so we do not race optimistic chips.
|
||||||
|
await expect(
|
||||||
|
page.getByRole('button', {
|
||||||
|
name: `Editar assessores em ${municipality.name} — ${advisor.name}`,
|
||||||
|
}),
|
||||||
|
).toBeVisible()
|
||||||
await page.keyboard.press('Escape')
|
await page.keyboard.press('Escape')
|
||||||
|
|
||||||
// Persistence: reload and reopen to confirm the server, not just local
|
// Persistence: reload and reopen to confirm the server, not just local
|
||||||
// state, now holds the assignment.
|
// state, now holds the assignment.
|
||||||
await page.reload()
|
await page.reload()
|
||||||
await page.getByRole('button', { name: 'Editar assessores' }).first().click()
|
await expect(campaignPageChrome(page, 'Municípios')).toBeVisible()
|
||||||
|
await page
|
||||||
|
.getByRole('button', {
|
||||||
|
name: `Editar assessores em ${municipality.name} — ${advisor.name}`,
|
||||||
|
})
|
||||||
|
.click()
|
||||||
await expect(
|
await expect(
|
||||||
page.locator('[data-slot="popover-content"]').getByRole('button', {
|
page.locator('[data-slot="popover-content"]').getByRole('button', {
|
||||||
name: `Remover ${advisor.name}`,
|
name: `Remover ${advisor.name}`,
|
||||||
|
|
@ -498,6 +514,7 @@ test.describe('Municípios — FAB overlay polish (B126)', () => {
|
||||||
await suggestResponse
|
await suggestResponse
|
||||||
await expect(overlay.getByRole('link', { name: 'Registrar sinal' })).toBeHidden()
|
await expect(overlay.getByRole('link', { name: 'Registrar sinal' })).toBeHidden()
|
||||||
|
|
||||||
|
// Overlay scopes search suggest — list page has no E11 SuggestionsPanel.
|
||||||
await expect(overlay.getByRole('region', { name: 'Sugestões' })).toBeVisible()
|
await expect(overlay.getByRole('region', { name: 'Sugestões' })).toBeVisible()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue