Skip to content

fix: correctly type testcafe bound queries #249

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

Merged
merged 3 commits into from
Sep 14, 2020

Conversation

Meemaw
Copy link
Contributor

@Meemaw Meemaw commented Sep 14, 2020

It should be possible to configure timeout on per query level. This is extremely important on projects where default selector timeout is very low, but some specific queries want to be performed with higher timeouts (case on a project I work on).

Also strongly types the functions, giving nice autocomplete for options:

Screenshot 2020-09-14 at 14 05 24

@benmonro
Copy link
Member

@Meemaw thank you for the PR. One question; curious if you tried using .with for this case? https://devexpress.github.io/testcafe/documentation/reference/test-api/selector/with.html

My concern is that we're merging the testcafe options into the Dom testing library options and that we could run into conflicts down the road.. Having said that, I do like the simplicity of this approach.

@Meemaw
Copy link
Contributor Author

Meemaw commented Sep 14, 2020

To be honest, I haven't tried .with before, but it works 🎉 .

That being said, I think number of options (1 for now, but I don't think we need any other) is rather small and we explicitly split them behind the scenes (not to pass them to DOM testing library). Also, as you said it looks a bit simpler.

I can also remove it, but keep the updated types that work better now (before it was any[] and there was no auto completion).

@Meemaw
Copy link
Contributor Author

Meemaw commented Sep 14, 2020

Okay, I think I prefer if we keep the function signature matching the underlying DOM testing library function signature for consistency. I've removed the option, but kept the updated types that will provide auto completion.

Also I've added a test case for the .with({timeout} option -- It cant hurt.

@Meemaw Meemaw changed the title feat: support testcafe Selector timeout option fix: correctly type testcafe bound queries Sep 14, 2020
@benmonro benmonro merged commit 8e632d5 into testing-library:master Sep 14, 2020
@benmonro
Copy link
Member

Agreed! Thanks as always

@benmonro
Copy link
Member

@Meemaw would you mind adding an example of this to the docs site?

@github-actions
Copy link

🎉 This PR is included in version 4.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants