chore(tests): Functional tests polish and skipping passwordless#20262
chore(tests): Functional tests polish and skipping passwordless#20262
Conversation
Because: - Passwordless tests are continuing to fail on stage and production - And, there is a flaky test looking for a specific string that can be modified outside of FxA code This commit: - Skips passwordless tests until they're ready - Updates enableRecoveryKey to check text with ignored case
There was a problem hiding this comment.
Pull request overview
Polishes functional test behavior by making one recovery-key assertion less brittle and by conditionally skipping passwordless API tests in environments where the feature isn’t enabled (stage/production), reducing noise from known failures.
Changes:
- Make
enableRecoveryKey’s initial status assertion case-insensitive to reduce flakiness from text casing changes. - Add a conditional skip for passwordless tests on stage/production targets.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/functional-tests/tests/resetPassword/resetPasswordRecoveryKey.spec.ts | Makes the “Not set” recovery-key status assertion case-insensitive. |
| packages/functional-tests/tests/passwordless/passwordlessApi.spec.ts | Adds conditional skip for stage/production and applies formatting-only tweaks in the test file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // TODO: Remove when passwordless is enabled in production | ||
| test.beforeEach(({}, { project }) => { | ||
| test.skip( | ||
| ['production', 'stage'].includes(project.name), |
There was a problem hiding this comment.
The conditional skip checks project.name against stage/production, but this file will still run under the stage-chromium and production-chromium projects (and any other suffixed project names). Consider basing the condition on the targetName worker fixture (stage/production) or matching via startsWith('stage') / startsWith('production') so all related projects are skipped consistently.
| ['production', 'stage'].includes(project.name), | |
| project.name.startsWith('production') || | |
| project.name.startsWith('stage'), |
There was a problem hiding this comment.
That seems a bit excessive
|
|
||
| test.describe('severity-2', () => { | ||
| // TODO: Remove when passwordless is enabled in production | ||
| test.beforeEach(({}, { project }) => { |
There was a problem hiding this comment.
test.beforeEach(({}, { project }) => { ... }) uses an empty destructuring pattern ({}), which is flagged by ESLint's no-empty-pattern rule (enabled via eslint:recommended). Use an unused identifier instead (e.g. (_, testInfo) or (_fixtures, { project })) to avoid a lint failure.
| test.beforeEach(({}, { project }) => { | |
| test.beforeEach((_fixtures, { project }) => { |
Because:
This commit:
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.