test(e2e): add Playwright tests for budget source bar chart rework (#1319)#1322
Merged
Conversation
Add projectedMinAmount and projectedMaxAmount fields to BudgetSource API response to expose the full cost range. For non-invoiced lines, min uses (1 - margin) and max uses (1 + margin). For invoiced lines, both min and max use actual cost. Existing projectedAmount field unchanged for backward compatibility. - Add computeProjectedRange() function calculating min/max bounds - Extend getSourceAmounts() to return both new fields - Update toBudgetSource() signature to accept and return new fields - Update all call sites (listBudgetSources, getBudgetSourceById) - Fix client test fixtures to include new required fields Co-Authored-By: Claude backend-developer (Haiku 4.5) <noreply@anthropic.com>
…nty (#1319) Replace 'Allocated' segment with 'Projected uncertainty' range visualization. Move Total to header badge, add interest rate subtitle. Replace legend with 3-row summary table (Projected, Paid, Claimed) showing both allocated and remaining amounts. Add srOnly text for screen readers. Changes: - Add --color-budget-projected-uncertainty token for light and dark themes - Update barChart i18n keys (remove allocated/total/available/planned, add srOnly and summary labels) - Rewrite SourceBarChart: 4 segments (claimed, paid, projected, projectedUncertainty), summary table - Add total badge in source header with aria-label - Add interest rate subtitle between sourceMain and SourceBarChart - Remove barLegend, sourceSummaryRow, amountNegative CSS classes - Add summaryTable, summaryRow, summaryLabel, summaryValues, summarySecondary, sourceInterestRate, totalBadge, srOnly CSS classes - Use projectedMinAmount and projectedMaxAmount for calculations Co-Authored-By: Claude frontend-developer (Haiku 4.5) <noreply@anthropic.com>
Add new `test.describe('Bar chart rework #1319')` block in budget-sources.spec.ts
covering: no Allocated text, total badge visibility, 3-row summary table
(Projected/Paid/Claimed), interest rate subtitle present/absent, and dark mode.
Update BudgetSourcesPage POM:
- Add getTotalBadge(), getSummaryLabels(), getInterestRateSubtitle() helpers
- Route deprecated getAmountLabelsInRow() to getSummaryLabels() (barLegendLabel
CSS class removed in #1319 rework)
Update existing 'Bar chart and summary row' test to match new structure:
- Assert exactly 3 summaryLabel rows instead of old summaryItem footer
- Assert 'Allocated' text is absent from source row
Fixes #1319
Co-Authored-By: Claude e2e-test-engineer (Sonnet 4.6) <noreply@anthropic.com>
Contributor
|
Thank you for your submission! We require all contributors to sign our Contributor License Agreement before we can accept your contribution. I have read the CLA Document and I hereby sign the CLA Frank Steiler seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
…ts (#1319) - Add 10 backend unit tests for computeProjectedRange / projectedMinAmount / projectedMaxAmount covering: empty source, single invoiced, non-invoiced own_estimate/quote/professional_estimate, mixed invoiced+non-invoiced, HI lines, all-invoiced, listBudgetSources/getBudgetSourceById field presence, and projectedAmount == projectedMaxAmount back-compat - Add 11 frontend tests for SourceBarChart rework: total badge, aria-label, 3-row summary table order, no "Allocated" label, no footer rows, projected range primary text, negative danger class on Projected row, interest rate subtitle presence/absence, no "allocated" segment in BudgetBar output Fixes #1319 Co-Authored-By: Claude qa-integration-tester (Sonnet 4.6) <noreply@anthropic.com>
…e tests (#1319) - Apply `summarySecondaryNegative` to Paid and Claimed row secondary values (fixes original requirement on #1319 that any negative `total - X` value renders in red/danger color) - Remove 6+ stale BudgetSourcesPage unit tests that asserted on the pre-rework legend/footer UI (Allocated, Overflow, old summary row labels) - Add 2 tests covering new Paid/Claimed negative-class behavior - Add LocaleContext mock to BudgetSourcesPage.test.tsx to unblock ESM test execution (useLocale() was throwing outside LocaleProvider) Fixes #1319 Co-Authored-By: Claude frontend-developer (Haiku 4.5) <noreply@anthropic.com> Co-Authored-By: Claude qa-integration-tester (Haiku 4.5) <noreply@anthropic.com>
Add :not([class*="summaryLabelDot"]) to the getSummaryLabels POM method so the substring selector doesn't inadvertently match the inner color dot span (CSS Modules hashes produce summaryLabel_xxx and summaryLabelDot_xxx, and [class*="summaryLabel"] matched both). Fixes #1319 Co-Authored-By: Claude dev-team-lead (Sonnet 4.6) <noreply@anthropic.com> Co-Authored-By: Claude e2e-test-engineer (Sonnet) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reworks the budget source bar chart on
/budget/sourcesto be clearer and less confusing:projectedMinAmountandprojectedMaxAmounttoBudgetSource(min/max confidence-margined projection range). ExistingprojectedAmountpreserved for back-compat.var(--color-danger); relocates interest rate to a subtitle under the source name; adds a new--color-budget-projected-uncertaintytoken for the range band.sources.barChart.*keys inenandde(removedallocated,total,available,planned; addedprojectedRange,projectedUncertainty,headroom,totalBadge,totalBadgeAriaLabel,summaryProjectedLabel,summaryPaidLabel,summaryClaimedLabel,srOnly).computeProjectedRange; frontend unit tests for the new summary table, total badge, negative-class on Paid/Claimed rows, and interest rate subtitle; E2E tests inbudget-sources.spec.tsasserting the new layout; stale tests for the old bar legend removed.Fixes #1319
Test plan
🤖 Generated with Claude Code