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

feat(tests): utils #838

Merged
merged 4 commits into from
Nov 7, 2024
Merged

feat(tests): utils #838

merged 4 commits into from
Nov 7, 2024

Conversation

RanyeM
Copy link
Collaborator

@RanyeM RanyeM commented Nov 7, 2024

Purpose

The importance of testing our code goes without saying. At the time we were moving fast and “breaking” things so to speak, but now in an effort to really mature MAKO and start to prepare for production we would like to improve not only test coverage but also the general stability of our code.

A lot of our newer code has unit tests built in, but that leaves some of the older rough edges to be tested. The fact of the matter is we are still developing against this older cold and in doing so it can be quite flaky. We would like to take the first step and unit test the building blocks to confidently grow the code base into the future.

The following utils should pass unit testing. The complexity is identified in the title of the story.

createContextProvider
crumbs
date (file can be removed)
formOrigin
location
stateNames
textHelpers
utils_

Linked Issues to Close

Links to issue(s) that are closed by this PR. Be sure to use the phrase "Closes #XXX" for each issue, so they automatically close

Approach

stateNames (review)
textHelpers (review)
formOrigin (review)
crumbs (review)
date (file was deleted as it could be removed)

Assorted Notes/Considerations/Learning

createContextProvider (can be removed in the future, doesn't need to be tested according to Brian and Asharon
location (will be removed for it's own ticket)
utils (has unit testing already, doesn't need to be tested)

@RanyeM RanyeM self-assigned this Nov 7, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.81% 5270 / 7658
🔵 Statements 68.29% 5575 / 8163
🔵 Functions 62.8% 1560 / 2484
🔵 Branches 37.66% 950 / 2522
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react-app/src/utils/crumbs.test.ts 100% 100% 100% 100%
react-app/src/utils/formOrigin.test.ts 100% 100% 100% 100%
react-app/src/utils/stateName.test.ts 100% 100% 100% 100%
react-app/src/utils/textHelpers.test.ts 100% 100% 100% 100%
Generated in workflow #576 for commit 6521619 by the Vitest Coverage Report Action

Copy link
Collaborator

@asharonbaltazar asharonbaltazar left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@asharonbaltazar asharonbaltazar changed the title Vitest test for statenames, formOrigin, textHelpers, and crumbs feat(tests): utils Nov 7, 2024
@RanyeM RanyeM merged commit f7bd0da into main Nov 7, 2024
8 checks passed
@RanyeM RanyeM deleted the utils-vitest branch November 7, 2024 19:10
@RanyeM RanyeM deployed to utils-vitest November 7, 2024 19:11 — with GitHub Actions Active
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.

2 participants