Skip to content
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

test(angular): Add @testing-library/angular #3255

Merged
merged 10 commits into from
Jan 4, 2023
Merged

Conversation

wlee221
Copy link
Contributor

@wlee221 wlee221 commented Jan 4, 2023

Description of changes

We were previously blocked on adding dom-testing-library to Angular because we were on unsupported version of Angular. Now that we've bumped to Angular 12, we can use @testing-library/angular.

Added snapshot test for all primitives while I was here. Other tests will follow in later PRs; purpose of this PR is to get testing library set up with some active tests running.

Issue #, if available

will unblock #2875

Description of how you validated changes

CI

Checklist

  • PR description included
  • yarn test passes
  • Tests are updated

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2023

⚠️ No Changeset found

Latest commit: 01e34a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wlee221 wlee221 temporarily deployed to ci January 4, 2023 02:32 — with GitHub Actions Inactive
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 02:32 — with GitHub Actions Inactive
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 02:32 — with GitHub Actions Inactive
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 02:32 — with GitHub Actions Inactive
@wlee221 wlee221 marked this pull request as ready for review January 4, 2023 03:02
@wlee221 wlee221 requested a review from a team as a code owner January 4, 2023 03:02
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 03:16 — with GitHub Actions Inactive
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 03:16 — with GitHub Actions Inactive
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 03:16 — with GitHub Actions Inactive
@wlee221 wlee221 temporarily deployed to ci January 4, 2023 03:17 — with GitHub Actions Inactive
componentProperties: { label: 'Password', fieldId: 'mockId' },
}
);
expect(container).toMatchSnapshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Snapshot tests are a great start, but we should also verify that the button is rendered with the correct label
perhaps using screen.getByText query. Same comment for the other tests, we could add more assertions.

Copy link
Contributor Author

@wlee221 wlee221 Jan 4, 2023

Choose a reason for hiding this comment

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

Right, I 100% agree. However I wanted to scope this PR just for setting up @testing-library/angular (we have been blocked on this for a while). Then I will make follow up PRs, across Angular and Vue, to establish those tests and also align any visual differences (e.g. #2875 that is WIP).

Does that sound good to you?

@wlee221 wlee221 merged commit 919c4d6 into main Jan 4, 2023
@wlee221 wlee221 deleted the angular-testing-library branch January 4, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants