-
Notifications
You must be signed in to change notification settings - Fork 52
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(react): define default prop of each components(Delay, Suspense) #709
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0fa4ea7
refactor(react): improved Delay Type and Add Test Code
ssi02014 06ef711
fix(react): remove unnecessary async
ssi02014 eee21aa
Merge branch 'main' into react/Delay
manudeli 84cc2a3
Update packages/react/src/Delay.tsx
ssi02014 e5353d3
Create swift-foxes-exist.md
dcfe420
Update packages/react/src/Delay.tsx
ssi02014 4f6a9ff
Update packages/react/src/contexts/DefaultOptionsContexts.ts
ssi02014 0b096b6
Update packages/react/src/wrap.tsx
ssi02014 ce22567
Update .changeset/swift-foxes-exist.md
2dae595
Create wild-carpets-study.md
b9348bf
fix(react): fixed test code for the Delay component
ssi02014 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@suspensive/react": patch | ||
--- | ||
|
||
fix(react): define default prop of each components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@suspensive/react": patch | ||
--- | ||
|
||
test(react): add test case for fallback prop of Delay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about more strictly by timeout option of waitFor?
https://testing-library.com/docs/dom-testing-library/api-async/#waitfor
because default timeout is 1000ms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manudeli
I know that option doesn't make much sense if we use a
fake timer
, but do you think it would be better to add it?In the above case, the timeout of waitFor is valid.
However, if we don't use fake time as shown above and don't specify the timeout option, the test will fail because, as you said, the default value of timeout is
1000ms
.If we use a fake timer, we don't necessarily need the timeout option - the above test will work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've given a large time value in the example above for illustration purposes (because the default value for timeout is 1000ms) 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference
https://stackoverflow.com/questions/65970116/react-testing-library-waitfor-not-working-with-settimeout/65970771#65970771?newreg=dcb8efd321ab40cea4e0e0646d9b6934