fix(e2e): correct Scenario 25 invoice amount to account for VAT gross-up (#1591)#1699
Merged
Merged
Conversation
…-up (#1591) The variance computation in AutoItemizePage sums effectiveLineAmount() which grosses up net (includesVat:false) amounts by 1.19. THREE_LINES has all three lines as net: 900+680+120 net = 1071+809.20+142.80 = 2023 gross. The test was using invoice amount=1700 (raw net sum), causing an immediate ~19% variance on page load and deterministic varianceMatch assertion failure. Fix: set invoice amount=2023 (gross total) so the initial state is a genuine 0% match, then editing line 0 to 500 net (=595 gross) produces a new gross total of 1547 vs 2023 = ~23.5% > 5% = varianceDanger as expected. Co-Authored-By: Claude e2e-test-engineer (Sonnet 4.5) <[email protected]>
Contributor
|
🎉 This PR is included in version 2.8.0-beta.18 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
7 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
invoice-auto-itemize-page.spec.ts: the variance indicator initial state assertiontoHaveClass(/varianceMatch/)was failing because the invoice amount of 1700 was the raw net sum, but the productionAutoItemizePagecomputes variance usingeffectiveLineAmount()which grosses upincludesVat:falselines by ×1.19THREE_LINESfixture: 900 + 680 + 120 (all net) → 1071 + 809.20 + 142.80 = 2023.00 grossamount: 2023in thecreateInvoiceViaApicall so the initial state is a genuine 0% variance →varianceMatchvarianceDanger(unchanged)Root Cause
The
effectiveLineAmount()gross-up was introduced in Stories #1677/#1678 after Scenario 25 was written. The test was written whenAutoItemizePagesummed rawtotalAmount, soamount: 1700was correct then. After the gross-up change, the production code computes 2023 as the effective total but the test still used 1700, causing an immediate 19% deviation on load.Test plan
invoice-auto-itemize-page.spec.tspasses on all viewports (desktop/tablet/mobile)THREE_LINESare unaffected (they don't assertvarianceMatch)amount: 1700in all other scenarios is correct (they don't depend on gross-total matching invoice amount)🤖 Generated with Claude Code