Skip to content

fix(tests): pass WAF header to passwordless API calls#20337

Merged
vbudhram merged 1 commit intomainfrom
investigate-334-failures
Apr 8, 2026
Merged

fix(tests): pass WAF header to passwordless API calls#20337
vbudhram merged 1 commit intomainfrom
investigate-334-failures

Conversation

@vbudhram
Copy link
Copy Markdown
Contributor

@vbudhram vbudhram commented Apr 8, 2026

Because

  • All 7 passwordless functional tests fail on stage with SyntaxError: Unexpected end of JSON input

This pull request

  • Passes target.ciHeader to all direct API calls in signinPasswordless.spec.ts
  • Passes this.target.ciHeader in testAccountTracker.ts for signUpPasswordless() and setupPasswordForPasswordlessAccount() (used by test setup and cleanup)

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-13413

Checklis

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

Other information

How to test:

CI_WAF_TOKEN=<token> yarn test-stage --grep "Passwordless API"

All 7 previously failing tests now pass. The CI_WAF_TOKEN is already set in CircleCI.

@vbudhram vbudhram requested a review from a team as a code owner April 8, 2026 20:14
Copilot AI review requested due to automatic review settings April 8, 2026 20:14
@vbudhram vbudhram changed the title fix(func-tests): pass WAF header to passwordless API calls fix(tests): pass WAF header to passwordless API calls Apr 8, 2026
@vbudhram vbudhram self-assigned this Apr 8, 2026
Copy link
Copy Markdown
Contributor

@StaberindeZA StaberindeZA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the functional test suite’s passwordless flows to include the CI WAF-bypass header (target.ciHeader) on direct auth-server API calls, addressing stage failures caused by WAF responses that aren’t valid JSON.

Changes:

  • Pass target.ciHeader to passwordlessSendCode / passwordlessConfirmCode (and passwordlessResendCode where used) in passwordless specs.
  • Update TestAccountTracker passwordless helpers to also forward this.target.ciHeader for passwordless signup and password setup flows.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/functional-tests/tests/passwordless/signinPasswordless.spec.ts Adds target.ciHeader to passwordless send/confirm API calls used within sign-in and cleanup flows.
packages/functional-tests/tests/passwordless/passwordlessApi.spec.ts Adds target.ciHeader to passwordless send/confirm/resend API calls in the passwordless API functional tests.
packages/functional-tests/lib/testAccountTracker.ts Ensures passwordless helper methods pass this.target.ciHeader to passwordless send/confirm calls used by setup/cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vbudhram vbudhram merged commit b99ae97 into main Apr 8, 2026
24 checks passed
@vbudhram vbudhram deleted the investigate-334-failures branch April 8, 2026 20:43
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.

4 participants