Skip to content

test: add type tests for within #1044

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 2 commits into from
Oct 1, 2021
Merged

test: add type tests for within #1044

merged 2 commits into from
Oct 1, 2021

Conversation

timdeschryver
Copy link
Member

What:

Follow up to #1034

Why:

I wanted to add generics to the within queries, but they already accept a generic.
I think adding a few tests could be helpful for potential changes in the future.

How:

Added a few tests and saw that the tests were passing

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • TypeScript definitions updated
  • Ready to be merged

cc @nstepien

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 30, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3dca6f9:

Sandbox Source
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Sep 30, 2021

Codecov Report

Merging #1044 (3dca6f9) into main (f27d14c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #1044   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          920       920           
  Branches       284       284           
=========================================
  Hits           920       920           
Flag Coverage Δ
node-12 100.00% <ø> (ø)
node-14 100.00% <ø> (ø)
node-16.9.1 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f27d14c...3dca6f9. Read the comment docs.

@@ -228,6 +229,18 @@ export async function testWaitFors() {
await waitFor(async () => {})
}

export async function testWithin() {
const sut = within(document.body)
Copy link
Member

Choose a reason for hiding this comment

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

What is "sut"?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's an abbreviation for "System Under Test", I couldn't think of a better name.
I can change it if you want though.

Copy link
Member

Choose a reason for hiding this comment

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

please 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem, renamed to container.

@eps1lon eps1lon merged commit 8c5c05d into main Oct 1, 2021
@eps1lon eps1lon deleted the test/within branch October 1, 2021 11:54
@github-actions
Copy link

github-actions bot commented Oct 4, 2021

🎉 This PR is included in version 8.7.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