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

Utils unit test #837

Closed
wants to merge 11 commits into from
Closed

Utils unit test #837

wants to merge 11 commits into from

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 so that we can 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)
utils (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)

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.79% 5270 / 7660
🔵 Statements 68.27% 5575 / 8165
🔵 Functions 62.77% 1560 / 2485
🔵 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%
react-app/src/utils/textHelpers.ts 100% 100% 100% 100%
Generated in workflow #571 for commit 2a8f22b by the Vitest Coverage Report Action

@RanyeM RanyeM closed this Nov 7, 2024
@RanyeM RanyeM deleted the utils-unitTest branch November 7, 2024 18:36
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.

1 participant