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

vitest: fix several tests #666

Merged
merged 5 commits into from
Aug 7, 2024
Merged

vitest: fix several tests #666

merged 5 commits into from
Aug 7, 2024

Conversation

AJSterner
Copy link
Contributor

@AJSterner AJSterner commented Jul 31, 2024

This PR for #662:

  • Updates the password queries for sign in page to select correct elements
  • updates PersonalProfile tests to correctly select navigation and tab elements
  • Makes the tests in CivicProfile and PersonalProfile todo instead of commenting out entire file

Resolves the following tests:

  • test/components/CivicProfileForms/FinancialInfo.test.jsx
  • test/components/Signup/PodRegistrationForm.test.jsx
  • test/pages/CivicProfile.test.jsx
  • test/pages/PersonalProfile.test.jsx
  • test/pages/Signup.test.jsx
  • test/components/Contacts/ContactListTableDesktop.test.jsx
  • test/components/Contacts/ContactListTableMobile.test.jsx

Future Steps/PRs Needed to Finish This Work (optional):

I believe this fixes all the tests.

- Updates the password queries for sign in page to select correct
  elements
- updates PersonalProfile tests to correctly select navigation and tab
  elements
- Makes the tests in CivicProfile and PersonalProfile `todo` instead of
  commenting out entire file

The following are fixed:
- test/components/CivicProfileForms/FinancialInfo.test.jsx
- test/components/Signup/PodRegistrationForm.test.jsx
- test/pages/CivicProfile.test.jsx
- test/pages/PersonalProfile.test.jsx
- test/pages/Signup.test.jsx
~
@AJSterner
Copy link
Contributor Author

😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈

Copy link
Contributor

@leekahung leekahung left a comment

Choose a reason for hiding this comment

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

Tests for PodRegistrationForm and Signup looks good (they passed the tests as intended with npm run test), can approve this for merging.

Although, now that I look at the two unit tests more, it feels like CivicProfile.test.jsx and PersonalProfile.test.jsx are supposed to be testing the same file (seeing that they both are rendering the CivicProfile component), but somehow the names diverged over time. Think we can kill one of the two test files.

The .todo()s are also a good idea until we get hard fixes on those tests. 👍

As for the unit test on Signup.test.jsx, think you and Andy could sort out which unit test update to keep from your two branches.

@AJSterner AJSterner mentioned this pull request Jul 31, 2024
12 tasks
@andycwilliams
Copy link
Member

We don't have a component called PersonalProfile so PersonalProfile.test.jsx can probably be renamed Profile.test.jsx

I can look closer tomorrow. I haven't compared the our different tests for Signup yet

@andycwilliams andycwilliams added bug Something isn't working MVP Issues related to MVP labels Aug 1, 2024
Copy link
Member

@andycwilliams andycwilliams left a comment

Choose a reason for hiding this comment

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

I agree that PersonalProfile.test isn't really doing a whole lot. It seems like that should be testing the Profile page but it doesn't.

There should be tests written for that instead of this. But I'm fine if it's not done with this specific PR, since we're already going to have multiple ones to fully finish the issue.

If not going to convert it into Profile.test.jsx and then make tests for it, I think PersonalProfile.test could be removed. Then we can create those tests later.

As for the Signup tests, we can just use yours. Mine are practically identical.

@leekahung
Copy link
Contributor

The unit test for PersonalProfile.test.jsx does not test the Profile component, but the CivicProfile component (see what the test is trying to render, there no imports for the Profile component).

We should merge the tests in there as part of CivicProfile.test.jsx.

@andycwilliams
Copy link
Member

andycwilliams commented Aug 6, 2024

@AJSterner Any updates?

I'm working on my own branch and would like to merge

@AJSterner
Copy link
Contributor Author

AJSterner commented Aug 7, 2024

@andycwilliams @leekahung consolidated the CivicProfile tests that were in the PersonalProfile.test.jsx profile into CivicProfile.test.jsx.

e119e7d

@andycwilliams andycwilliams self-requested a review August 7, 2024 01:53
@AJSterner AJSterner merged commit d1d60b6 into Development Aug 7, 2024
3 checks passed
@AJSterner AJSterner deleted the 662/asterner-unit-tests branch August 7, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MVP Issues related to MVP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants