Add in unit tests for Data and Utility functions CRASM-3507#1484
Merged
Add in unit tests for Data and Utility functions CRASM-3507#1484
Conversation
ameliav
approved these changes
Jan 29, 2026
jsalinasnttdata
approved these changes
Jan 30, 2026
rapidray12
approved these changes
Jan 30, 2026
Collaborator
rapidray12
left a comment
There was a problem hiding this comment.
The test scripts are now broken up (segmented in their own files) which makes them easier to follow
I don't like the hard coded dates. The dates should be declared separately. Same thing with the hard coded colors
We need to sit down and come up with a scheme to organize all of the constants used by the testing routines. It will make it much easier in the future to update the tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗣 Description
These tests verify the severity color utilities return the expected colors for each severity and stay consistent across helpers. They also validate the date utilities format dates and ranges correctly, handle timezone conversions, and cover key edge cases and invalid inputs to prevent regressions.
💭 Motivation and context
Make sure we validate these shared utility functions (dates and severity colors), so UI changes and refactors don’t accidentally break formatting or user workflows across the app.
🧪 Testing
Tested locally
dateUtils.ts : 33 tests
getSeverityColor.ts: 7 tests
✅ Pre-approval checklist