diff --git a/tests/e2e/campaignPeople.e2e.spec.ts b/tests/e2e/campaignPeople.e2e.spec.ts index 4a026e24..76d020cd 100644 --- a/tests/e2e/campaignPeople.e2e.spec.ts +++ b/tests/e2e/campaignPeople.e2e.spec.ts @@ -24,6 +24,32 @@ test.describe('Pessoas — lista unificada', () => { * * HTTP twin: tests/e2e/campaignPeopleHttp.e2e.spec.ts. */ + test('the omnibox narrows the people recorte', async ({ campaign, page }) => { + const { fixtures } = campaign + const coordinator = await fixtures.createCampaignUser('coordinator', { + name: fixtures.value('Coordenadora Pessoas'), + }) + const municipality = await fixtures.claimMunicipality() + const { contactName } = await fixtures.createStaffLeadership({ + namePrefix: 'Liderança Pessoas', + municipalities: [municipality], + }) + + await campaign.login(page, coordinator.email!, coordinator.password) + + await page.goto('/campanha/pessoas') + await expect(campaignPageChrome(page, 'Pessoas')).toBeVisible() + + // The omnibox search narrows the recorte (canonical URL, chips mounted). + const omnibox = page.getByRole('combobox', { name: 'Filtrar pessoas' }) + await omnibox.fill(contactName.slice(0, 8)) + await omnibox.press('Enter') + await expect(page).toHaveURL(/q=/) + // The filter navigation re-streams the list — let it commit before the row. + await page.waitForFunction(() => document.querySelectorAll('div[id^="S:"]').length === 0) + await expect(page.getByRole('row', { name: new RegExp(contactName) })).toBeVisible() + }) + test('staff sorts by a column header and filters absence via the omnibox (C117)', async ({ campaign, page,