Repository navigation
test(printing): establish cross-renderer receipt parity and regression contract - #451
Merged
Merged
Conversation
Contributor
Greptile SummaryThe PR adds a semantic receipt-parity test suite across the backend, WebUSB, and browser-print renderers and wires it into the root test chain.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tests/print-parity.test.ts | Adds shared receipt fixtures and semantic parity coverage for backend, WebUSB, and browser HTML rendering. |
| package.json | Registers the parity suite in the root test chain and adds the encoder dependency required by its frontend imports. |
| package-lock.json | Locks the newly declared receipt encoder and its transitive dependencies. |
Reviews (3): Last reviewed commit: "test(printing): root dep for parity suit..." | Re-trigger Greptile
khaira777
added a commit
that referenced
this pull request
Aug 22, 2026
…ertions - Declare @point-of-sale/receipt-printer-encoder at the repo root so a root-only npm ci && npm test resolves test:print-parity without needing frontend/node_modules (greptile P1). - Scope every amount assertion in tests/print-parity.test.ts to its own labeled row (Subtotal/Discount/TOTAL) so unrelated digits elsewhere in the receipt cannot satisfy them (greptile P2). Fixes review findings on PR #451.
Adds tests/print-parity.test.ts, a semantic (not byte-level) contract covering all three receipt renderers: desktop ESC/POS formatReceipt, WebUSB receipt encoders, and browser web-print HTML. Asserts items, totals, discount, payments, reprint banners and business headers across classic/compact templates at 32/42/48 columns. Documents current skip-with-warning behavior for unsupported scripts as LEGACY markers for the multilingual print epic (#438), including the WebUSB quirk where '…'-truncated long names are dropped whole. Shared fixtures are exported for reuse by later epic issues.
…ertions - Declare @point-of-sale/receipt-printer-encoder at the repo root so a root-only npm ci && npm test resolves test:print-parity without needing frontend/node_modules (greptile P1). - Scope every amount assertion in tests/print-parity.test.ts to its own labeled row (Subtotal/Discount/TOTAL) so unrelated digits elsewhere in the receipt cannot satisfy them (greptile P2). Fixes review findings on PR #451.
khaira777
force-pushed
the
fm/flocafe-439-parity
branch
from
August 22, 2026 05:29
293df1c to
01fcdd2
Compare
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.
Intent
Land the salvaged printing parity-contract work as a PR resolving issue #439, the first merge of epic #438. The work was pre-written by the captain as commit 28970f8 on local branch test/printing-parity-contract (exists nowhere else) and is already committed on feature branch fm/flocafe-439-parity, rebased onto origin/main (origin/main equals the branch base a14323c, so no drift; the #450 printing changes are not yet merged). The change adds tests/print-parity.test.ts - a semantic (not byte-level) cross-renderer receipt parity and regression contract covering all three renderers: backend ESC/POS formatReceipt, frontend WebUSB receipt encoders, and browser web-print HTML, across classic/compact templates at 32/42/48 columns - with LEGACY markers documenting today's skip-with-warning handling of unsupported scripts for the multilingual print epic, plus exported shared fixtures for later epic issues; package.json gains test:print-parity wired into the test chain after test:printer-migrations. Local validation: npm run test:print-parity green (208 assertions, 0 failed), npm run lint clean except one pre-existing unrelated warning in frontend/src/lib/api.ts. Delivery requirements: PR title 'test(printing): cross-renderer receipt parity contract'; PR body references Fixes #439 and Refs #438; never push to the default branch; never merge the PR; when CI green open the PR if the pipeline has not, then post exactly ONE concise comment on issue #439 linking the PR and describing coverage (captain authorized that single issue update); no other public comments.
What Changed
Final changed paths and statuses:
Risk Assessment
✅ Low: Test-only change adding a parity contract that exercises real renderer APIs across all three print paths; no production code modified, no runtime behavior changed.
Testing
Installed frontend npm dependencies (required for @point-of-sale/receipt-printer-encoder used by frontend receipt-encoder module), then ran npm run test:print-parity which exercised all renderer × template × column-width combinations (backend 12 combos, WebUSB 9 combos, browser HTML 4 combos) totaling 208 semantic assertions with 0 failures. Also verified the exported buildParityFixtures function is importable and returns correct fixture data, and confirmed test:print-parity is correctly positioned after test:printer-migrations in the test chain.
Evidence: test:print-parity full output (208 assertions, 0 failed)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm run test:print-parityts-node --transpile-only -P tests/tsconfig.json -e "const { buildParityFixtures } = require('./tests/print-parity.test'); ..." (export verification)grep test:printer-migrations.*test:print-parity package.json (ordering check)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.