-
Notifications
You must be signed in to change notification settings - Fork 84
test(dialog): add play functions #7522
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
Conversation
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.
In addition to Ed's comments, it's worth considering that using userInteractionPause to simulate very short amounts of delay goes against the reason for it being used in the first place. For example, userInteractionPause(50) would simulate a user "waiting" for 0.05s which is near instantaneous.
Whilst we should be avoiding using it in certain situations, if it is needed the length of time should be more realistic (e.g. to simulate a user waiting a few seconds for a modal to open and any associated animation to complete)
I agree with Damo when it comes to using pauses when we want to simulate user's behavior and I think it came out also in one of the previous reviews. |
Apologies Debra, looking back I think I've badly-worded my original comment (or ended it without making any actual point). What I meant was that, in 90% of cases, a simple |
src/components/anchor-navigation/anchor-navigation-interactions.stories.tsx
Outdated
Show resolved
Hide resolved
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'm confused why some AnchorNav changes are in this PR but I've assumed it was an accident and that it was meant for a separate one so have added comments to these files to help etc
src/components/anchor-navigation/anchor-navigation-interactions.stories.tsx
Outdated
Show resolved
Hide resolved
src/components/anchor-navigation/anchor-navigation-interactions.stories.tsx
Outdated
Show resolved
Hide resolved
src/components/anchor-navigation/anchor-navigation-interactions.stories.tsx
Outdated
Show resolved
Hide resolved
src/components/anchor-navigation/anchor-navigation-interactions.stories.tsx
Outdated
Show resolved
Hide resolved
Ok, I think I misunderstood the idea as well then, as I remember we discuss it before and agree on using this method over toBeVisible. I am following the comments now and took a note of the method preference for a future. |
3e12942 to
537d707
Compare
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.
There's not much value in calling focus() and then asserting it's focused, I think we should test the behaviour built into the component where focus is on the wrapper on open
edd16ab to
53a0fb0
Compare
17918f6
5ee2f92 to
85766bc
Compare
0b654c9
0913f63 to
cbead49
Compare
a56fd15 to
da520ce
Compare
Proposed behaviour
Adding play functions to the Dialog component.
Current behaviour
There are no play functions in this component currently.
Checklist
d.tsfile added or updated if requiredQA
Additional context
Testing instructions