Skip to content

fix(fxa-settings): clean up noisy test output across test suite in fxa-settings#20009

Merged
vbudhram merged 1 commit intomainfrom
fix-settings-tests-output
Feb 10, 2026
Merged

fix(fxa-settings): clean up noisy test output across test suite in fxa-settings#20009
vbudhram merged 1 commit intomainfrom
fix-settings-tests-output

Conversation

@vbudhram
Copy link
Contributor

@vbudhram vbudhram commented Feb 6, 2026

Because

  • The fxa-settings tests were very noisy which polluted the context window making it harder to iterate and debug actual test errors
  • It was annoying

This pull request

  • Fix act() warnings by using async findBy* queries, waitFor wrappers, and act() around direct async callback calls in tests affected by react-hook-form and async useEffect state updates
  • Suppress jsdom requestSubmit not-implemented errors in setupTests.tsx
  • Suppress expected console output in error-path tests with mockImplementation
  • Fix React key-in-spread warning in PageRecentActivity component
  • Remove leftover debug console.log in CompleteResetPassword container
  • Use deterministic Date.now spy for MfaGuard debounce test

Issue that this pull request solves

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

Checklist

  • 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).

Other information (Optional)

Screenshot 2026-02-05 at 9 50 36 PM

@vbudhram vbudhram self-assigned this Feb 6, 2026
@vbudhram vbudhram requested a review from a team as a code owner February 6, 2026 02:56
@vbudhram vbudhram force-pushed the fix-settings-tests-output branch from 5cfd97c to 39d0fb0 Compare February 6, 2026 03:06
Copy link
Contributor

@nshirley nshirley left a comment

Choose a reason for hiding this comment

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

I'm curious your thoughts on adding an env override to disable the log suppression - I like the approach but having an easy way to turn it off would be nice

});

it('debounces OTP resend requests', async () => {
// Use a deterministic clock so debounce logic is not affected by system load.
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

filter: (msg: string) => boolean
): T =>
((...args: any[]) => {
if (filter(String(args[0]))) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: having a way to disable the filtering with an explicit ENV var override would be nice. I can see us looking for one of these messages

and I mention because I've seen the Model Validation Errors and Missing field messages, and they imply we're not testing something as we should be so we should probably fix what's causing the issues at some point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nshirley I added the env flag

expect(currentIndexProps?.processEmailSubmission).toBeDefined();
});
await currentIndexProps?.processEmailSubmission(MOCK_EMAIL);
await act(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Makes me happy seeing these cleaned up again! just give it a few months though, they'll be back

@vbudhram vbudhram force-pushed the fix-settings-tests-output branch from 39d0fb0 to bbe63ce Compare February 9, 2026 18:13
@vbudhram vbudhram requested a review from nshirley February 9, 2026 19:27
@nshirley nshirley self-assigned this Feb 10, 2026
Copy link
Contributor

@nshirley nshirley left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning these up AND for adding that env flag to disable the output filtering.

@vbudhram vbudhram merged commit 715433b into main Feb 10, 2026
21 checks passed
@vbudhram vbudhram deleted the fix-settings-tests-output branch February 10, 2026 20:32
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.

2 participants