-
Notifications
You must be signed in to change notification settings - Fork 0
Add comprehensive unit tests for utils and feature flags #193
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
Conversation
Co-authored-by: dkhalife <1736645+dkhalife@users.noreply.github.com>
Co-authored-by: dkhalife <1736645+dkhalife@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive unit tests for TypeScript utility functions and feature flags, restructuring the test organization by moving all test files to a dedicated test/ folder at the project root.
- Created 78 unit tests covering all utility functions and feature flags with 100% coverage
- Reorganized test structure by moving test files from
src/totest/folder - Updated Jest configuration to reference the new test folder location
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/test/utils/storage.test.ts | Tests for localStorage storage/retrieval functions with type safety and error handling |
| frontend/test/utils/grouping.test.ts | Tests for default expanded state generation for due date and label grouping |
| frontend/test/utils/dom.test.ts | Tests for mobile detection, document title setting, and theme application |
| frontend/test/utils/date.test.ts | Tests for ordinal suffix generation covering all day numbers and edge cases |
| frontend/test/utils/colors.test.ts | Tests for text color computation and color option lookups from predefined palette |
| frontend/test/constants/featureFlags.test.ts | Tests for feature flag storage/retrieval with proper prefixing and default values |
| frontend/jest.config.js | Updated Jest configuration to reference new test folder structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
|
|
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove the empty lines between test blocks to maintain consistent spacing throughout the file.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dkhalife <1736645+dkhalife@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Overview
This PR adds comprehensive unit tests for TypeScript utility functions and feature flags helper methods as requested. All tests have been organized in a new
test/folder that is a sibling to thesrc/folder, following best practices for test organization.Changes
Test Organization
frontend/test/directory structure with subdirectories forutils/andconstants/sample.test.ts,setupTests.ts) fromsrc/totest/folderjest.config.jsconfiguration to reference the new test folder locationTest Coverage
Utils Tests (100% coverage for targeted files)
storage.ts - 16 tests covering:
colors.ts - 13 tests covering:
date.ts - 13 tests covering:
dom.ts - 11 tests covering:
grouping.ts - 9 tests covering:
Feature Flags Tests (100% coverage)
featureFlags.ts - 16 tests covering:
Test Quality
beforeEachhooks for cleanupNotes
useRoot()function indom.tswas intentionally not tested due to module-level state caching between test runsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.