Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace unreliable setTimeout usage with waitFor #28620

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

Matt561
Copy link
Contributor

@Matt561 Matt561 commented Nov 21, 2024

Description

This PR aims to improve a flaky test for the add-contact component.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Run the test locally

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@Matt561 Matt561 requested a review from a team as a code owner November 21, 2024 16:39
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM, great catch!

@Matt561 Matt561 enabled auto-merge November 21, 2024 16:56
@Matt561 Matt561 added this pull request to the merge queue Nov 21, 2024
Copy link
Contributor

@cryptotavares cryptotavares left a comment

Choose a reason for hiding this comment

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

Nice catch.. left a really minor comment.

Comment on lines +68 to +70
await waitFor(() =>
expect(getByText('Recipient address is invalid')).toBeInTheDocument(),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can findBy* queries here and avoid using the waitFor.

@metamaskbot
Copy link
Collaborator

Builds ready [95041d4]
Page Load Metrics (1782 ± 69 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16082268178513866
domContentLoaded15912158174612962
load16002263178214469
domInteractive26174473216
backgroundConnect8106352813
firstReactRender483701337034
getState56314168
initialActions01000
loadScripts11451583129110249
setupStore56716199
uiStartup177427672060231111
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Merged via the queue into develop with commit 9f8d61b Nov 21, 2024
81 checks passed
@Matt561 Matt561 deleted the fix/replace-set-timeout-in-add-contact-test branch November 21, 2024 17:20
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2024
@metamaskbot metamaskbot added the release-12.9.0 Issue or pull request that will be included in release 12.9.0 label Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.9.0 Issue or pull request that will be included in release 12.9.0 team-identity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants