-
Notifications
You must be signed in to change notification settings - Fork 58
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
Feature/dom testing library #226
Feature/dom testing library #226
Conversation
🦋 Changeset detectedLatest commit: 170cdb7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@stefcameron Here's my first stab at it! I still have three TODO items that I mentioned in the PR description. The biggest thing that I wanted to confirm with you is that there's no reason to keep the Karma setup around anymore, right? If that's the case, there is a whole bunch of config code that I can strip out. |
Looks good! In regard to the radio button tests, the difference you get from the previous test code is that the new code doesn't attach the fixtures to the DOM. It doesn't break the behavior of most cases, but radio buttons have some query usage to find other group elements. And it make sense that "tabbable" elements would be attached to the DOM. Not sure the |
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.
Great work, @thawkin3 , this is looking nice! Thanks for the nice summary in the PR description. I don't see any reason to keep Karma around. There's no other purpose for it beside running tests that are now run by Jest, so it can be ripped out rather than preserved.
@stefcameron Awesome, I'll rip out Karma in another commit soon and add it to this PR. This PR is going to get a whole lot bigger with all the deletions! |
…ature/dom-testing-library
@idoros Well I learned something new today! Thanks for pointing that out. To avoid any other possible surprises, I made sure to actually append all of the test examples to the DOM now. You were spot on, and that fixed the radio button tests. |
@stefcameron @idoros This behemoth of a PR is ready for a second round of review! Here's a quick summary of what I've changed since our last conversation:
|
@thawkin3 Thanks for the updated summary -- so helpful! -- and the additional work. I'll check this out sometime tomorrow. |
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.
This looks great to me, nice work, thank you! 🎉 I'm really happy to have this repo now also using the Testing Library.
@all-contributors add @thawkin3 for test, infra, doc |
I've put up a pull request to add @thawkin3! 🎉 |
@all-contributors add @idoros for review |
I've put up a pull request to add @idoros! 🎉 |
@stefcameron Thanks! It was fun to work on. I see you've approved this now, so are we good to merge this today? Or are we waiting on the timing for anything else? |
I'm merging now. I was just pausing just in case there were any last words. 😄 |
@all-contributors add @idoros for review |
I've put up a pull request to add @idoros! 🎉 |
Haha thanks! |
I've re-written the test suite using Jest and DOM Testing Library. 🎉
This PR is somewhat large, so the following summary of changes should help:
@testing-library/dom
,@testing-library/jest-dom
,babel-jest
,jest
, andjest-watch-typeahead
jest.config.js
file,setupTests.js
file, ESLint configuration, Babel configuration, script inpackage.json
, and GitHub workflow configurationfocusable
,isFocusable
,tabbable
, andisTabbable
a[xlink:href]
attributesCloses #225
PR Checklist
Please leave this checklist in your PR.
Typings added/updated.yarn changeset
locally to add one, and follow the prompts).