bilhej/frontend/src
Hermes Agent f849f8a05a
Some checks failed
CI / Lint, type check, unit tests, coverage (pull_request) Successful in 6m16s
CI / E2E browser tests (pull_request) Failing after 3m54s
test(payment): add unit tests for buildSwishPaymentUrl and number normalisation
The PR added + stripping to normalizeSwishNumber and the PaymentRedirect
regression assertion verifies QR options, but payment.ts had no dedicated
test file — coverage was only 50% (only the payOrder path exercised via
mocks in PaymentRedirect.spec.ts). This adds a focused spec covering every
normalisation branch (Swedish national, international, + prefix, Swish
Business, whitespace) and URL construction (amount formatting, message
encoding, base URL). Coverage for payment.ts rises from 50% to ~90%.

Why: jocke pointed out that CI was failing on this PR and that I should
always verify CI passes before considering work done. Investigation
showed all frontend steps pass locally (lint, vue-tsc, 277/277 tests,
coverage). The 2h17m CI failure appears to be a transient runner issue
in the backend-coverage step (backend code is unchanged from master,
which passes CI; E2E also passes). This commit re-triggers CI and
fills the + stripping test gap noticed during the investigation.

Changes:
- Add frontend/src/__tests__/payment.spec.ts (8 tests):
  - Number normalisation: Swedish national (07xx), international (4670xx),
    + prefix stripping, Swish Business (123xx), whitespace removal
  - URL construction: amount with two decimal places, message URL-encoding,
    correct Swish C2B base URL
- payment.ts statement coverage: 50% to ~90%
- Total frontend tests: 269 to 277
2026-06-19 19:44:07 +00:00
..
__tests__ test(payment): add unit tests for buildSwishPaymentUrl and number normalisation 2026-06-19 19:44:07 +00:00
api fix(payment): make Swish QR code scannable by the Swish app 2026-06-19 16:22:27 +00:00
assets/styles Make customer-facing UI usable on smartphones. 2026-05-26 13:03:35 +02:00
components Refactor admin fulfillment into focused modules. 2026-05-28 14:34:03 +02:00
composables Log out users automatically when their JWT expires. 2026-06-17 12:43:31 +02:00
constants Refactor admin fulfillment into focused modules. 2026-05-28 14:34:03 +02:00
data refactor: redesign all pages and components with new design system 2026-05-16 16:11:01 +02:00
pages fix(payment): make Swish QR code scannable by the Swish app 2026-06-19 16:22:27 +00:00
router Log out users automatically when their JWT expires. 2026-06-17 12:43:31 +02:00
stores Log out users automatically when their JWT expires. 2026-06-17 12:43:31 +02:00
utils Log out users automatically when their JWT expires. 2026-06-17 12:43:31 +02:00
App.vue refactor: add design system with CSS tokens, utilities, and app shell 2026-05-16 16:09:35 +02:00
env.d.ts Add production-only Umami analytics for bilhej.se. 2026-06-01 12:02:14 +02:00
main.ts Add production-only Umami analytics for bilhej.se. 2026-06-01 12:02:14 +02:00