mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
Allow agents to rewrite prior code; stop pinning layout Tailwind.
Clarify that new Issues track work and do not fence closed-ticket code, and replace brittle className layout assertions with structure/data-slot contracts.
This commit is contained in:
parent
4a1bbb758b
commit
854daf6309
12 changed files with 66 additions and 77 deletions
|
|
@ -49,7 +49,7 @@ Contra o repositório **antes** de pontuar:
|
|||
|
||||
| Check | Ação se verdadeiro |
|
||||
| ------------------------------------------------------ | --------------------------------------------------------------- |
|
||||
| Já no diff / código da sessão | → balde **já_resolvido** (não reabrir) |
|
||||
| Já no diff / código da sessão | → balde **já_resolvido** (já coberto nesta sessão — não registrar de novo) |
|
||||
| Já em `docs/plans/*.md` ou numa Issue (grep + `gh issue list`) | → **absorver** no plano existente ou **descartar** como coberto |
|
||||
| Pré-existente em `main`, fora do escopo da entrega | → **descartar** deste lote (bug separado só se o usuário pedir) |
|
||||
| Intentional em `DESIGN.md` / decisão travada | → **descartar** (ex.: field-mode mobile documentado) |
|
||||
|
|
@ -135,7 +135,7 @@ Para cada lote com destino **registrar** ou **absorver**:
|
|||
3. Se **absorver** num plano existente: edite o plano (nova fase/seção) — mesmo precedente "Gap vs 2022". **Se a Issue dona do plano estiver `in-progress`, NÃO a edite** — registra como Issue nova com `--depends <id-do-pai>` (destrava sozinha quando o pai flipar `done`).
|
||||
4. Se **defer**: anote o gatilho no plano-pai (Adiado com gatilho / Explicitamente fora) ou na mensagem de triage confirmada — não crie Issue só por isso.
|
||||
5. No plano, seções obrigatórias além do template:
|
||||
- **Já resolvido no simplify/critique (não reabrir)**
|
||||
- **Já resolvido no simplify/critique** (coberto nesta sessão — não registrar de novo; o implementador **pode** ainda mudar esse código numa Issue futura se o fix correcto exigir)
|
||||
- **Explicitamente fora** (skips dos revisores + descartes + defers com gatilho deste triage)
|
||||
6. Self-score de decisão ≥4/5 antes de gravar; classe Impeccable A–D conforme o lote (só-backend = A; UX pós-critique = B/C).
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ Ordem topológica intra-lote (o plano do dependente cita o ID do dependido, que
|
|||
3. **Classificar superfície UI (A–D)** e semear âncoras: `PRODUCT.md`/`DESIGN.md`, design-ref em `docs/design-refs/latest/` se houver, shells existentes. Classe C exige **brief compacto** (persona, job, estratégia de cor, anti-goals) no plano. Proibido: rodar craft/critique/polish aqui.
|
||||
4. **Dados → decisão → apresentação** ([data-presentation.md](data-presentation.md)) ou `Dados: N/A`.
|
||||
5. **Decisões caras + doubt (quando couber):** para cada decisão caro-de-reverter (schema, access, Consent, URL imutável, multi-collection), use a forma Opções+Recomendação+rejeitadas. Se a decisão for **não trivial** no sentido de [decision-quality.md](decision-quality.md) § Doubt, faça um ciclo curto CLAIM → adversarial self-check (ou `Task` fresh-context) **antes** de gravar como Decisão travada. Não doubt em rename/copy.
|
||||
- **Continuação de UI/layout:** Issue nova para tracking é OK. **Proibido** travar "Item novo, não reabrir Bxx / Issues fechadas" como desculpa para só patchar localmente e deixar CSS compensatório intacto. Se o sintoma já teve 1+ tickets no mesmo eixo (padding, bleed, snap), a Decisão travada deve dizer **quem possui o inset/altura** e autorizar reescrever o código das Issues anteriores. "Não reabrir Issue fechada" = bookkeeping do GitHub, não cerca de código.
|
||||
6. **Posicionamento:** prioridade `P0..P3` (jurídico/caminho crítico > base de dados > operação de campo > inteligência > plataforma), `depends` (IDs duros), appetite, janela do calendário eleitoral quando relevante, `serializes` quando toca recurso compartilhado (ex.: migrations).
|
||||
7. **Fatiar em fases verticais** ([decision-quality.md](decision-quality.md) § Fatias): não “toda a DB → toda a API → toda a UI”. Cada fase = caminho fino ponta a ponta (ou o pedaço mínimo que deixa o sistema verde), com **aceite**, **verify** (`pnpm gate:fast` / pin unit|int / check manual), arquivos prováveis, tamanho S/M. **Fase 1 = tracer bullet** (schema mínimo → uma action → uma superfície, ou o menor path que prova a aposta). High-risk / incerteza primeiro. Se a fatia seria L/XL (≫5 arquivos ou >1 sessão focada) → mais fases **ou** Issue bipartida `{id}-plan` / `{id}-exec`.
|
||||
8. **Boundaries Teqo** no plano (sempre, compacto): o que esta entrega **Always** / **Ask first** / **Never** — ver template. Defaults do repo (overrideAccess, transação, Consent fail-closed, sem Neon) entram em Always/Never sem inventário genérico.
|
||||
|
|
|
|||
|
|
@ -108,7 +108,13 @@ de produto que originou o item, com data. Responde "por que isso existe".>
|
|||
|
||||
<!-- Só decisões caras de reverter. Formato: decisão + por quê + fonte/data + alternativas rejeitadas.
|
||||
Ver decision-quality.md. Decisão silenciosa ou sem alternativas rejeitadas é defeito.
|
||||
Decisão repo-wide além deste item → marcar "candidata a doc em docs/" (não criar ADR schema novo sem precedente). -->
|
||||
Decisão repo-wide além deste item → marcar "candidata a doc em docs/" (não criar ADR schema novo sem precedente).
|
||||
|
||||
ANTI-PADRÃO (layout/UI): NÃO escreva "Item novo, não reabrir Bxx / Issues fechadas"
|
||||
como se isso proibisse tocar código antigo. Issue nova = tracking. Se o fix correcto
|
||||
exige reescrever o as-built de Issues fechadas (apagar bleed compensatório, mover
|
||||
ownership de padding), diga isso explicitamente aqui e autorize o work-issue a fazê-lo.
|
||||
"Não reabrir Issue no GitHub" ≠ "não mude o código daquela Issue". -->
|
||||
|
||||
- **<Decisão em negrito>.** <Racional e fonte com data.> **Rejeitado:** <alternativa A porque …; B porque …>.
|
||||
- **i18n e naming** seguem o AGENTS.md: identificadores em inglês (<listar os principais
|
||||
|
|
|
|||
|
|
@ -122,6 +122,14 @@ Ordem fixa, fases pequenas e verificáveis, respeitando o appetite do plano:
|
|||
|
||||
Tracer bullet: se a Issue for grande, a primeira fatia vertical real (schema mínimo → uma action → uma superfície UI) vem cedo.
|
||||
|
||||
### Código de Issues anteriores (obrigatório)
|
||||
|
||||
Issue nova = ticket de tracking. **Não** é cerca em volta do código.
|
||||
|
||||
- Se o fix correcto exige alterar código entregue por Issues **já fechadas** (apagar CSS compensatório, mudar quem possui o padding, reverter uma decisão local, fundir duas camadas), **faça-o nesta entrega**. Atualize ou delete pins unitários que congelavam a camada errada.
|
||||
- **"Não reabrir Issue fechada"** (quando aparece em planos) significa só: não reabra o GitHub Issue para bookkeeping — abra Issue nova. **Nunca** significa "não toque no código daquela Issue".
|
||||
- **Zoom-out na 2ª falha do mesmo sintoma de layout/geometria:** se o plano aponta uma causa local (`px-4` no `ul`, `-mx-*`, overflow) e o produto ainda vê o bug, **pare** e reavalie ownership no composition tree (quem deve possuir o inset?) antes de abrir um 3º ticket compensatório. Não empilhe bleed sobre bleed.
|
||||
|
||||
## Passo 5 — /simplify + débitos
|
||||
|
||||
Rode `/simplify` sobre o diff da sessão **antes** do Passo 6. Não pule os reviewers — o simplify deste fluxo é o comando completo, não uma leitura manual do diff.
|
||||
|
|
|
|||
|
|
@ -93,6 +93,10 @@ Vercel Git builds: `scripts/vercel-ignore-build.sh` skipeia **todas** as branche
|
|||
|
||||
Supervisor remoto (`agent-pool.yml`): schedule + replenish em merge → `main` + dispatch. Workers PR `--base main`. Default model `composer-2.5`. **Secret `POOL_GITHUB_TOKEN`** obrigatório se `GITHUB_TOKEN` 403 em `/actions/variables`. Doctor: `pnpm agent:pool -- doctor`. Skill: `agent-pool`.
|
||||
|
||||
## Código de Issues fechadas
|
||||
|
||||
Issue nova = tracking. **Não** cerca o código. Se o fix correcto exige alterar o as-built de Issues já `done`/`in-prod` (apagar CSS compensatório, mudar ownership de layout, reverter decisão local), o agente faz isso na Issue actual e actualiza/apaga pins que congelavam a camada errada. "Não reabrir Issue fechada" = bookkeeping do GitHub, **nunca** "não toque nesse código". Em layout/geometria: na 2ª falha do mesmo sintoma, zoom-out de ownership no composition tree — não empilhar bleed sobre bleed (`work-issue` § Código de Issues anteriores).
|
||||
|
||||
## Guardrails / leitura
|
||||
|
||||
`pnpm agent:file-miss` → harvest → `docs/GUARDRAILS.md`. Always-on: `AGENTS.md` → codebase-map → engineering-standards → esta página → PRODUCT/DESIGN/CUSTOMER.
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ Modules the 2026-07 hardening phases touch, and where their behavior is pinned:
|
|||
| Entity list loaders (Pass 2 W0) | scope (leader empty/denied), marker-narrowed q, kind/status filters, pagination shape | `campaignEntityListData.int.spec.ts` | advisor loader runs post-gate with `overrideAccess: true` (gate asserted upstream) |
|
||||
| Codebase conventions (tooling guards, 2026-07-25) | `server-only` on Payload-coupled utilities; Praça/Núcleo copy ban; eslint legacy-ignore existence; formActions wrapper usage | `codebaseConventions.unit.spec.ts` | boundary rules themselves live in ESLint (`no-restricted-imports`) + madge in CI |
|
||||
|
||||
## What to pin (and what not to)
|
||||
|
||||
- **Pin behavior and structure:** roles, `aria-*`, `data-slot` / `data-*` contracts, hrefs, parsed URL state, access denials, loader shapes, exported CSS _constants_ when the constant _is_ the API (`HOME_SEARCH_GROUP_LIST_CLASS`).
|
||||
- **Do not pin Tailwind utility strings for layout geometry** (`expect(el.className).toContain('px-4')`, `-mx-4`, `w-[calc(100%+2rem)]`, `gap-1`, `pb-2`, …). Those freeze compensatory layers and block the honest fix (move inset ownership up the tree). Prefer: slot presence, `data-*` ownership flags, computed box in e2e, or no pin.
|
||||
- **Selected / pressed visual state:** prefer `aria-pressed` / `data-state` / role over matching `border-primary` in `className`.
|
||||
- Exception: a unit that pins an **exported** class-name constant may assert equality to that constant — not a free-floating utility substring invented in the test.
|
||||
|
||||
## Characterization Backlog
|
||||
|
||||
- [ ] `src/utilities/posts.ts` — dedicated spec for `isPostVisible` fail-closed matrix and cache wrappers (confirmed 2026-07-28, Pass 3 audit).
|
||||
|
|
|
|||
|
|
@ -91,13 +91,12 @@ describe('CampaignHomeActionButton', () => {
|
|||
expect(screen.getByLabelText('Em breve').getAttribute('aria-disabled')).toBe('true')
|
||||
})
|
||||
|
||||
it('uses a wider control column for two-line labels (B109)', () => {
|
||||
it('exports a shared control class for two-line labels (B109)', () => {
|
||||
renderActionButton({ label: 'Registrar', icon: BarChart3 })
|
||||
const control = screen.getByRole('button', { name: 'Registrar' })
|
||||
expect(control.className).toContain('box-content')
|
||||
expect(control.className).toContain('w-[5.5rem]')
|
||||
expect(actionControlClassName).toContain('box-content')
|
||||
expect(actionControlClassName).toContain('w-[5.5rem]')
|
||||
for (const token of actionControlClassName.split(/\s+/).filter(Boolean)) {
|
||||
expect(control.className.split(/\s+/)).toContain(token)
|
||||
}
|
||||
})
|
||||
|
||||
it('opens the description drawer on long-press when the pointer is coarse', () => {
|
||||
|
|
@ -188,14 +187,11 @@ describe('CampaignHomeActionStrip', () => {
|
|||
)
|
||||
|
||||
const scroller = getScroller(container)
|
||||
expect(scroller?.className).toContain('overflow-x-auto')
|
||||
expect(scroller?.className).toContain('scrollbar-width:none')
|
||||
const list = scroller?.querySelector('ul[role="list"]')
|
||||
expect(scroller).toBeTruthy()
|
||||
expect(scroller.getAttribute('aria-label')).toBe('Ações rápidas')
|
||||
const list = scroller.querySelector('ul[role="list"]')
|
||||
expect(list).toBeTruthy()
|
||||
expect(list?.className).toContain('gap-0')
|
||||
expect(list?.className).toContain('px-0')
|
||||
expect(list?.className).not.toContain('px-4')
|
||||
expect(list?.className).not.toContain('gap-2')
|
||||
expect(list?.querySelectorAll(':scope > li')).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('scrolls horizontally on pointer-fine drag past the threshold', () => {
|
||||
|
|
|
|||
|
|
@ -4,14 +4,6 @@ import { describe, expect, it } from 'vitest'
|
|||
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
|
||||
|
||||
describe('CampaignHomeLayout', () => {
|
||||
it('fills the scrollport height on mobile', () => {
|
||||
const { container } = render(<CampaignHomeLayout actions={<p>Actions block</p>} />)
|
||||
|
||||
const root = container.firstElementChild
|
||||
expect(root?.className).toContain('h-full')
|
||||
expect(root?.className).toContain('min-h-0')
|
||||
})
|
||||
|
||||
it('renders actions in the home-actions slot inside home-dock', () => {
|
||||
const { container } = render(<CampaignHomeLayout actions={<p>Actions block</p>} />)
|
||||
|
||||
|
|
@ -20,24 +12,12 @@ describe('CampaignHomeLayout', () => {
|
|||
expect(actions?.closest('[data-slot="home-dock"]')).not.toBeNull()
|
||||
})
|
||||
|
||||
it('bleeds home-actions edge-to-edge on mobile (compensates scroll p-4)', () => {
|
||||
const { container } = render(<CampaignHomeLayout actions={<p>Actions block</p>} />)
|
||||
|
||||
const actions = container.querySelector('[data-slot="home-actions"]')
|
||||
expect(actions?.className).toContain('-mx-4')
|
||||
expect(actions?.className).toContain('w-[calc(100%+2rem)]')
|
||||
expect(actions?.className).toContain('md:mx-0')
|
||||
expect(actions?.className).toContain('md:w-auto')
|
||||
})
|
||||
|
||||
it('does not clip horizontal bleed on the actions retraction shell', () => {
|
||||
it('allows horizontal bleed on the actions retraction shell', () => {
|
||||
const { container } = render(<CampaignHomeLayout actions={<p>Actions block</p>} />)
|
||||
|
||||
const actionsChrome = container.querySelector('[data-slot="home-actions-chrome"]')
|
||||
const bleedWrapper = actionsChrome?.querySelector('[data-allow-horizontal-bleed="true"]')
|
||||
expect(bleedWrapper).not.toBeNull()
|
||||
expect(bleedWrapper?.className).toContain('overflow-y-hidden')
|
||||
expect(bleedWrapper?.className).not.toContain('overflow-hidden')
|
||||
})
|
||||
|
||||
it('renders search slot inside home-dock when provided', () => {
|
||||
|
|
@ -68,8 +48,6 @@ describe('CampaignHomeLayout', () => {
|
|||
expect(chrome).not.toBeNull()
|
||||
expect(spacer).not.toBeNull()
|
||||
expect(spacer?.getAttribute('aria-hidden')).toBe('true')
|
||||
expect(spacer?.className).toContain('flex-1')
|
||||
expect(spacer?.className).toContain('md:hidden')
|
||||
expect(chrome?.nextElementSibling?.getAttribute('data-slot')).toBe('home-dock')
|
||||
})
|
||||
|
||||
|
|
@ -85,12 +63,11 @@ describe('CampaignHomeLayout', () => {
|
|||
|
||||
const homeChrome = container.querySelector('[data-slot="home-chrome"]')
|
||||
expect(homeChrome?.getAttribute('data-retracted')).toBe('true')
|
||||
expect(homeChrome?.className).toContain('grid-rows-[0fr]')
|
||||
expect(homeChrome?.className).toContain('opacity-0')
|
||||
expect(homeChrome?.getAttribute('aria-hidden')).toBe('true')
|
||||
|
||||
const actionsChrome = container.querySelector('[data-slot="home-actions-chrome"]')
|
||||
expect(actionsChrome?.getAttribute('data-retracted')).toBe('true')
|
||||
expect(actionsChrome?.className).toContain('grid-rows-[0fr]')
|
||||
expect(actionsChrome?.getAttribute('aria-hidden')).toBe('true')
|
||||
|
||||
expect(container.querySelector('[data-slot="home-thumb-spacer"]')).not.toBeNull()
|
||||
expect(container.querySelector('[data-slot="home-summary"]')).not.toBeNull()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignLis
|
|||
import { CampaignScopeBadge } from '@/components/campaign/shared/CampaignScopeBadge'
|
||||
|
||||
describe('CampaignListPageHeader (B118)', () => {
|
||||
it('keeps h1 in the DOM with sr-only on mobile and hides subtitle and scope chip below md', () => {
|
||||
it('keeps h1 in the DOM with sr-only chrome on mobile (B118)', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
createElement(CampaignListPageHeader, {
|
||||
title: 'Municípios',
|
||||
|
|
@ -17,11 +17,8 @@ describe('CampaignListPageHeader (B118)', () => {
|
|||
|
||||
expect(html).toContain('<h1')
|
||||
expect(html).toContain('sr-only')
|
||||
expect(html).toContain('md:not-sr-only')
|
||||
expect(html).toContain('hidden')
|
||||
expect(html).toContain('md:block')
|
||||
expect(html).toContain('md:contents')
|
||||
expect(html).toContain('Municípios')
|
||||
expect(html).toContain('Os 435 municípios da campanha.')
|
||||
expect(html).toContain('435 municípios')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ describe('CampaignQuickActionsDrawer (B105)', () => {
|
|||
expect(screen.getByRole('button', { name: 'Mostrar ações rápidas' })).toBeTruthy()
|
||||
})
|
||||
|
||||
it('bleeds the action strip edge-to-edge inside the drawer gutter (B101)', () => {
|
||||
it('mounts the action strip inside the drawer context (B101)', () => {
|
||||
vi.mocked(postCampaignJson).mockResolvedValue({
|
||||
ok: true,
|
||||
payload: idleSuggestPayload,
|
||||
|
|
@ -171,10 +171,8 @@ describe('CampaignQuickActionsDrawer (B105)', () => {
|
|||
)
|
||||
|
||||
const context = document.getElementById('quickActionContext')
|
||||
const stripBleed = context?.firstElementChild
|
||||
expect(stripBleed?.className).toContain('-mx-4')
|
||||
expect(stripBleed?.className).toContain('w-[calc(100%+2rem)]')
|
||||
expect(stripBleed?.querySelector('[aria-label="Ações rápidas"]')).not.toBeNull()
|
||||
expect(context?.querySelector('[aria-label="Ações rápidas"]')).not.toBeNull()
|
||||
expect(screen.getByRole('link', { name: 'Registrar' })).toBeTruthy()
|
||||
})
|
||||
|
||||
it('posts home-search when the drawer query is active', async () => {
|
||||
|
|
@ -365,7 +363,7 @@ describe('CampaignQuickActionsDrawer (B105)', () => {
|
|||
expect((screen.getByLabelText('Buscar na campanha') as HTMLInputElement).value).toBe('')
|
||||
})
|
||||
|
||||
it('uses compact bottom stack spacing in the drawer (B112)', () => {
|
||||
it('keeps search results under the drawer search stack (B112)', () => {
|
||||
vi.mocked(postCampaignJson).mockResolvedValue({
|
||||
ok: true,
|
||||
payload: idleSuggestPayload,
|
||||
|
|
@ -374,11 +372,10 @@ describe('CampaignQuickActionsDrawer (B105)', () => {
|
|||
renderQuickActionsChrome(<CampaignQuickActionsDrawer actions={[]} />)
|
||||
|
||||
const context = document.getElementById('quickActionContext')
|
||||
expect(context?.className).toContain('gap-1')
|
||||
expect(context?.className).toContain('pb-[max(0.25rem,env(safe-area-inset-bottom,0px))]')
|
||||
|
||||
const searchStack = document.querySelector('[data-slot="home-search-results"]')?.parentElement
|
||||
expect(searchStack?.className).toContain('gap-1.5')
|
||||
expect(context).not.toBeNull()
|
||||
const results = document.querySelector('[data-slot="home-search-results"]')
|
||||
expect(results).not.toBeNull()
|
||||
expect(context?.contains(results)).toBe(true)
|
||||
})
|
||||
|
||||
it('toggles between dock and collapsed from the handle', () => {
|
||||
|
|
@ -430,7 +427,7 @@ describe('CampaignQuickActionsDrawer (B105)', () => {
|
|||
})
|
||||
|
||||
describe('CampaignContentScroll quick-actions direction (B105)', () => {
|
||||
it('uses compact bottom padding on Início when quick-actions peek is off (B116)', () => {
|
||||
it('marks compact home bottom padding on Início when quick-actions peek is off (B116)', () => {
|
||||
render(
|
||||
<CampaignContentScroll quickActionsPeek={false} compactHomeBottomPadding>
|
||||
<div />
|
||||
|
|
@ -439,9 +436,6 @@ describe('CampaignContentScroll quick-actions direction (B105)', () => {
|
|||
|
||||
const scrollport = document.querySelector('[data-slot="campaign-content-scroll"]')
|
||||
expect(scrollport?.getAttribute('data-home-compact-bottom-padding')).toBe('true')
|
||||
expect(scrollport?.className).toContain('pb-2')
|
||||
expect(scrollport?.className).toContain('px-4')
|
||||
expect(scrollport?.className).not.toContain(' p-4')
|
||||
})
|
||||
|
||||
it('collapses on scroll down and re-docks on scroll up', () => {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ describe('CampaignWizardShell', () => {
|
|||
expect(main.getAttribute('aria-label')).toBe(wizardFlowChromeAriaLabel('Ajustar votos'))
|
||||
})
|
||||
|
||||
it('uses tighter top padding on mobile when step title is omitted', () => {
|
||||
it('renders main without step title when step title is omitted', () => {
|
||||
const { container } = renderWizardShell({
|
||||
flowTitle: 'Ajustar votos',
|
||||
stepTitle: null,
|
||||
|
|
@ -112,10 +112,8 @@ describe('CampaignWizardShell', () => {
|
|||
})
|
||||
|
||||
const main = container.querySelector('main')
|
||||
expect(main?.className).toMatch(/pt-2/)
|
||||
expect(main?.className).not.toMatch(/pt-3/)
|
||||
expect(main?.className).toMatch(/pb-6/)
|
||||
expect(main?.className).toMatch(/md:py-6/)
|
||||
expect(main).not.toBeNull()
|
||||
expect(main?.getAttribute('aria-label')).toBe(wizardFlowChromeAriaLabel('Ajustar votos'))
|
||||
})
|
||||
|
||||
it('skips title focus when contentFocus is none', () => {
|
||||
|
|
@ -194,7 +192,7 @@ describe('CampaignWizardShell', () => {
|
|||
expect(document.activeElement).toBe(screen.getByRole('heading', { level: 1, name: 'Passo 2' }))
|
||||
})
|
||||
|
||||
it('shows municipality caption in main on desktop breakpoint classes', () => {
|
||||
it('shows municipality caption in main', () => {
|
||||
const { container } = renderWizardShell({
|
||||
flowTitle: 'Ajustar votos',
|
||||
stepTitle: 'Pergunta',
|
||||
|
|
@ -204,12 +202,16 @@ describe('CampaignWizardShell', () => {
|
|||
children: null,
|
||||
})
|
||||
|
||||
const caption = container.querySelector('main p.md\\:block')
|
||||
expect(caption?.textContent).toBe('Cairu')
|
||||
expect(caption?.className).toMatch(/md:block/)
|
||||
const main = container.querySelector('main')
|
||||
expect(main).not.toBeNull()
|
||||
expect(
|
||||
within(main as HTMLElement)
|
||||
.getByText('Cairu')
|
||||
.tagName.toLowerCase(),
|
||||
).toBe('p')
|
||||
})
|
||||
|
||||
it('uses tighter top padding on mobile main content', () => {
|
||||
it('renders main content for the municipality entry step', () => {
|
||||
const { container } = renderWizardShell({
|
||||
flowTitle: 'Ajustar votos',
|
||||
stepTitle: WIZARD_MUNICIPALITY_STEP_TITLE,
|
||||
|
|
@ -219,8 +221,7 @@ describe('CampaignWizardShell', () => {
|
|||
})
|
||||
|
||||
const main = container.querySelector('main')
|
||||
expect(main?.className).toMatch(/pt-3/)
|
||||
expect(main?.className).toMatch(/pb-6/)
|
||||
expect(main?.className).toMatch(/md:py-6/)
|
||||
expect(main).not.toBeNull()
|
||||
expect(within(container).getByText(WIZARD_MUNICIPALITY_STEP_TITLE)).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -40,9 +40,7 @@ describe('HomeSearchResultsLayout', () => {
|
|||
)
|
||||
|
||||
const layout = container.querySelector('[data-slot="home-search-results-layout"]')
|
||||
expect(layout?.className).toContain('flex-col')
|
||||
expect(layout?.className).toContain('md:grid-cols-2')
|
||||
expect(layout?.className).toContain('lg:grid-cols-3')
|
||||
expect(layout).not.toBeNull()
|
||||
expect(screen.getByText('Group A')).toBeTruthy()
|
||||
expect(screen.getByText('Group B')).toBeTruthy()
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue