Skip to content

[ALFMOB-424] Fix failing checkout integration tests (valid phone fixture) - #83

Draft
amccall-mindera wants to merge 1 commit into
mainfrom
task/ALFMOB-424-fix-checkout-integration-tests
Draft

[ALFMOB-424] Fix failing checkout integration tests (valid phone fixture)#83
amccall-mindera wants to merge 1 commit into
mainfrom
task/ALFMOB-424-fix-checkout-integration-tests

Conversation

@amccall-mindera

@amccall-mindera amccall-mindera commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

Fix the 3 failing checkout integration tests in checkout_integration_test.dart by replacing the invalid phone fixture +1234567890 with the valid +44 7700 900000.

Why

ALFMOB-355 (#77) merged to main with 3 red checkout integration tests. They all stalled at the contact information screen. Its Continue button is gated on UserData.isValid(), which calls FormUtils.validatePhoneNumberPhoneNumber.parse(value).isValid (the phonenumbers_core validation added in ALFMOB-326). +1234567890 is not a valid number (only 9 digits after +1), so the button never enabled:

  • Submit button disabled when form is invalid — asserted the button becomes enabled once all fields are filled; got false.
  • User can proceed through checkout successfully — tapped a disabled Continue, so never reached the Delivery Information screen (find.text('Delivery Information') → 0 widgets).
  • UI state updates correctly during checkout — same stall, then StateError filling delivery fields that were never rendered.

This is a stale test fixture, not an app bug — the production phone validation is correct and unchanged. These tests passed end-to-end before ALFMOB-326 tightened phone validation.

How

Replaced all 5 occurrences of +1234567890 in the test file with +44 7700 900000 — the same known-valid number asserted in test/utils/form_utils_test.dart. The phone field has no input formatters, so the spaced value enters cleanly.

Test

  • CI smoke integration suite on this PR must show the checkout suite fully green (was 5 passed / 3 failed).
  • No production code changed; unit tests unaffected.

See

Link to JIRA: ALFMOB-424

The 3 failing checkout integration tests all stalled at the contact
information screen: its Continue button is gated on UserData.isValid(),
which calls FormUtils.validatePhoneNumber -> PhoneNumber.parse().isValid
(phonenumbers_core, added in ALFMOB-326). The fixture '+1234567890' is
not a valid number (only 9 digits after +1), so the button never enabled:

- 'Submit button disabled when form is invalid' asserted the button
  becomes enabled once all fields are filled (got false).
- 'User can proceed through checkout successfully' tapped a disabled
  Continue, never reached the Delivery Information screen.
- 'UI state updates correctly during checkout' did the same, then threw
  StateError filling delivery fields that were never rendered.

Replace the fixture with '+44 7700 900000', the same valid number the
form_utils unit test uses. App validation behaviour is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

LCOV of commit 4445a87 during CI #767

Summary coverage rate:
  source files: 157
  lines.......: 86.4% (2570 of 2976 lines)
  functions...: no data found
  branches....: 80.9% (772 of 954 branches)
Message summary:
  111 ignore messages:
    inconsistent: 111

Files changed coverage rate: n/a

Full coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant