From 4979cc1767b0b919d65dee64a794a3c6199482b5 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Mon, 24 Aug 2026 16:12:53 -0300 Subject: [PATCH] fix: prettier format --- scripts/lib/e2e-affected-manifest.mjs | 6 ++- tests/e2e/campaignPeople.e2e.spec.ts | 47 ++++++++++++++++----- tests/unit/e2eAffectedManifest.unit.spec.ts | 4 +- 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/scripts/lib/e2e-affected-manifest.mjs b/scripts/lib/e2e-affected-manifest.mjs index 8a6c9855..edb6ef87 100644 --- a/scripts/lib/e2e-affected-manifest.mjs +++ b/scripts/lib/e2e-affected-manifest.mjs @@ -22,7 +22,9 @@ const CAMPAIGN_APP = 'src/app/(campaign)/campanha/(app)' * it requires editing the invariant pin on purpose. */ export const E2E_CURATED_SPECS = [ - 'campaignPermissionProfile', + // OPS87 — deliberate: the permission-profile family moved to the + // browserless HTTP mode (same coverage, new spec name). + 'campaignPermissionProfileHttp', 'campaignDemandVisibility', 'campaignAiTranscribe', 'campaignAgendaFeed', @@ -197,7 +199,7 @@ export const E2E_AFFECTED_MANIFEST = [ // invariant pins require the pair to stay in sync. { prefixes: ['src/utilities/access', 'src/utilities/campaignAccess.ts'], - specs: ['campaignPermissionProfile', 'campaignDemandVisibility'], + specs: ['campaignPermissionProfileHttp', 'campaignDemandVisibility'], }, { prefixes: ['src/utilities/ai'], diff --git a/tests/e2e/campaignPeople.e2e.spec.ts b/tests/e2e/campaignPeople.e2e.spec.ts index 3b0e6b6b..76d020cd 100644 --- a/tests/e2e/campaignPeople.e2e.spec.ts +++ b/tests/e2e/campaignPeople.e2e.spec.ts @@ -13,18 +13,43 @@ import type { CampaignUser } from '../../src/payload-types.js' * merged person row, and the route stays locked for leaders. */ test.describe('Pessoas — lista unificada', () => { + /** + * OPS87 — client slice of `campaignPeople` after the HTTP migration. The + * server-side assertions (list render, C130 columns, party filter, name link, + * leader redirects, detail sections, C117 URL contracts) moved to + * tests/e2e/campaignPeopleHttp.e2e.spec.ts with the original test names, 1:1; + * what remains here is the interaction only a browser can exercise: omnibox + * typing, sortable-header clicks with `aria-sort`, mobile card ordering, and + * the cell combobox/dialog writes (C125/C128/C131). + * + * 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() + }) -/** - * OPS87 — client slice of `campaignPeople` after the HTTP migration. The - * server-side assertions (list render, C130 columns, party filter, name link, - * leader redirects, detail sections, C117 URL contracts) moved to - * tests/e2e/campaignPeopleHttp.e2e.spec.ts with the original test names, 1:1; - * what remains here is the interaction only a browser can exercise: omnibox - * typing, sortable-header clicks with `aria-sort`, mobile card ordering, and - * the cell combobox/dialog writes (C125/C128/C131). - * - * HTTP twin: tests/e2e/campaignPeopleHttp.e2e.spec.ts. - */ test('staff sorts by a column header and filters absence via the omnibox (C117)', async ({ campaign, page, diff --git a/tests/unit/e2eAffectedManifest.unit.spec.ts b/tests/unit/e2eAffectedManifest.unit.spec.ts index b4653ae9..162fcab7 100644 --- a/tests/unit/e2eAffectedManifest.unit.spec.ts +++ b/tests/unit/e2eAffectedManifest.unit.spec.ts @@ -52,7 +52,9 @@ describe('E2E_AFFECTED_MANIFEST (OPS5)', () => { // The curated set is the never-zero answer for high-risk PR diffs; change // it on purpose (cost of the PR CI high-risk path), not by drift. expect(E2E_CURATED_SPECS).toEqual([ - 'campaignPermissionProfile', + // OPS87 — deliberate: the permission-profile family moved to the + // browserless HTTP mode (same coverage, new spec name). + 'campaignPermissionProfileHttp', 'campaignDemandVisibility', 'campaignAiTranscribe', 'campaignAgendaFeed',