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: Write unit tests for settings page and components #290

Merged
merged 9 commits into from
Dec 20, 2024

Conversation

belhajManel
Copy link
Contributor

What changed?

Resolves #235

  • Added unit tests for the following settings components:
    • DeleteAccountSetting
    • EditBirthplaceSetting
    • EditMinorSetting
    • EditNameSetting
    • EditResidenceSetting
    • EditThemeSetting

Why?

Providing test coverage in the user settings functionalities

How was this change made?

Mocked external services to isolate the component behavior, particularly API calls related to user data.

How was this tested?

By testing tests.

Copy link

changeset-bot bot commented Dec 17, 2024

⚠️ No Changeset found

Latest commit: 7a2bb00

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

@github-actions github-actions bot added frontend CSS, HTML, and JS changes testing Unit and e2e tests labels Dec 17, 2024
Copy link
Member

@evadecker evadecker left a comment

Choose a reason for hiding this comment

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

This is awesome! Yay tests! This will really help increase confidence that things are doing what they should be.

I left some small comments about combining tests and focusing testing unique display logic. Overall, great work!

@belhajManel
Copy link
Contributor Author

Updated all the points except the as unknown as ReturnType and Editing theme, will spend a little more time on them.

Tell me if we need to tweak anything else! (Kudos for the comments)

@evadecker
Copy link
Member

Updated all the points except the as unknown as ReturnType and Editing theme, will spend a little more time on them.

Tell me if we need to tweak anything else! (Kudos for the comments)

This is awesome! Thank you so much for the tests and the changes. If you can't figure out a way to eliminate the as unknown it's not a big deal—I got stuck on that typing, too 😭

@belhajManel
Copy link
Contributor Author

I did a last cleanup but we'll figure out a way for the famous as unknown 🤞

Copy link
Member

@evadecker evadecker left a comment

Choose a reason for hiding this comment

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

I'm going to go ahead and approve this because all the tests look great! If you're able to figure out how to remove as unknown, even better, but I'd consider that a bonus—don't spend too much time on that if it's not leading anywhere.

Leave a comment when you feel ready to go.

@belhajManel
Copy link
Contributor Author

Re-reviewed I think we're good to go🎉

@evadecker evadecker merged commit dc730c3 into namesakefyi:main Dec 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend CSS, HTML, and JS changes testing Unit and e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write unit tests for settings page and components
2 participants