fix(e2e): alinha Sel.quote.approvalLimit/Requested com testids reais (sem suffix -value)#13
Conversation
…(sem suffix -value)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughSeletores de teste end-to-end para o diálogo de aprovação de desconto foram renomeados em duas mudanças sincronizadas: a definição do fixture remove o sufixo MudançasRenomear seletores de aprovação
Esforço estimado de review🎯 1 (Trivial) | ⏱️ ~5 minutos Possíveis PRs relacionadas
Reviewers sugeridos
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Alinha o SSOT de seletores E2E (Sel.quote.*) e o spec de aprovação de desconto com os data-testid reais já presentes no componente (sem sufixo -value), evitando falhas de localização de elementos no DOM durante execução autenticada.
Changes:
- Renomeia seletores
approvalLimitValue/approvalRequestedValueparaapprovalLimit/approvalRequestedeme2e/fixtures/selectors.ts. - Atualiza o spec
04c-quote-discount-approvalpara usar os novos seletores alinhados ao DOM.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| e2e/flows/04c-quote-discount-approval.spec.ts | Atualiza o spec para apontar para Sel.quote.approvalLimit/approvalRequested, compatível com os testids reais. |
| e2e/fixtures/selectors.ts | Corrige o SSOT de seletores para remover o sufixo -value e refletir os data-testid existentes no UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* fix: resolve TS/ESLint errors in items #9–#17 (exhaustive bug fix batch) #9 price-response.adapter.ts — typed 4 helper fns (asRec/str/num/bool/optStr) to eliminate 61 TS errors from snake/camelCase + null-safety issues #10 AdminProductFormPage.tsx — fixed PromobrindProduct field access after expanding ~50 optional fields in product-types.ts #11 AddressTab.tsx — replaced Record<string,unknown> form props with typed interfaces, eliminating 56 TS errors #12 BasicDataTab.tsx — same root cause as #11, typed interfaces applied, 32 TS errors resolved #13 CompareTableView.tsx — changed import from @/types/product.ts (DB snake_case) to @/types/product-catalog.ts (UI camelCase), fixing 26 TS errors #14 SupabaseConnectionsTab.tsx — replaced 17 non-null assertions (!) with nullish coalescing (??) + type casts #15 CatalogContent.tsx + ProductQuickView.tsx — removed unused imports/vars, resolving 32 ESLint warnings #16 useSimulatorWizard.ts — added dispatch to all 15 useCallback/useEffect dep arrays; useGlobalSearch.ts — removed unused imports, stabilised callback, fixed non-null assertions and missing deps #17 T-FIX-5b ESLint guardrail added to eslint.config.js; guards added before forEach+expect loops in commercial-intelligence.test.ts; baselines updated to grandfather existing violations in magic-up tests Baselines: .tsc-baseline.json (1065 errors frozen), .eslint-baseline.json (405) * fix(#17): fix all T-FIX-5b forEach+expect violations in magic-up tests - magic-up-result-panel-keyboard.test.tsx: 64 violations fixed - getDots()/getThumbs() forEach (getAllByRole throws on empty): eslint-disable-next-line - Literal arrays [prev,next], [0,1,2]: eslint-disable-next-line - calls/elements/observedIndices: expect(var).not.toHaveLength(0) guards added - REQUIRED_*_CLASSES consts: eslint-disable-next-line - ids/thumbNames/liveRegions: guards added - magic-up-onda5.test.tsx: 29 violations fixed - required/select.allCards/allMarcar/literal arrays: eslint-disable-next-line - cards/listitems/winnerButtons/buttons/tabIndices: guards added - REQUIRED_FOCUS_CLASSES const: eslint-disable-next-line ESLint baseline updated: 405 → 401 errors (positive drift on all T-FIX-5b work) * fix(#17): suppress T-FIX-5b in commercial-intelligence (guards already in place) All 14 remaining forEach+expect violations suppressed with // eslint-disable-next-line no-restricted-syntax after the existing expect(array).not.toHaveLength(0) guards. Arrays are provably non-empty static constants (PERIOD_OPTIONS=9, MOCK_TRENDING=4, MOCK_OPPORTUNITIES=4) or deterministic generators (generateDateMap(30), generateMockMarketData(360)). Pattern applied consistently with magic-up test fixes from previous commit: - Guard documents intent (catches accidental empty-array mutation) - Disable comment acknowledges guard is in place and suppresses the lint rule Result: 0 T-FIX-5b errors in all 3 test files. T-FIX-5b work fully complete. --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Codex Simulation <codex-simulation@example.local>
Contexto
Auditoria pós-merge do PR #12 (
ed0a4bd) encontrou um bug real introduzido na consolidação multi-instância: 3 fontes desalinhadas sobre os mesmos 2 elementos de UI.O bug
Consequência prática: os testes 2 e 3 do
04c-quote-discount-approval.spec.tsFALHARIAM quando rodados com auth real —page.locator('[data-testid="quote-approval-limit-value"]')nunca acharia o elemento, pois o DOM contém[data-testid="quote-approval-limit"](sem suffix).Fix (opção B aprovada pelo PO)
Renomeia SSOT + spec para usar o nome sem suffix que está no componente. Componente intocado.
Causa raiz
Coordenação multi-instância falha no PR #12: outra instância Claude iniciou o branch usando nomes com
-value. Ao consolidar tudo num commit consolidado, adicionei osdata-testidno componente sem o suffix mas mantive SSOT + spec com-value. Erro de revisão da minha parte.Validação
npx playwright test --list -g "discount approval": 3 testes reconhecidos, sintaxe okapprovalLimitValueouapprovalRequestedValueem todo o repoquote-approval-limitequote-approval-requested(sem suffix)Escopo mínimo
4 linhas mudadas em 2 arquivos, nenhuma mudança de comportamento. Apenas alinhamento de nomes entre SSOT/spec e componente.
Summary by cubic
Aligns e2e selectors with the actual
data-testids for the quote approval cards by removing the-valuesuffix. Fixes Playwright locators in the 04c discount approval tests; component code remains unchanged.Written for commit 71c362c. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
Release Notes