test(wasap): add tests for fetchWasapPageData#1332
Open
fhennig wants to merge 3 commits into
Open
Conversation
Also converts WasapAnalysisMode, SignatureType, ExcludeSetName to const-object pattern (matching VARIANT_TIME_FRAME), adds SEQUENCE_TYPE for the external SequenceType, exports fetchWasapPageData for direct testing, and adds BackendRouteMocker.mockGetCollection to routeMocker.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens the W-ASAP frontend test coverage by adding unit tests for fetchWasapPageData across all supported analysis modes, while also aligning several W-ASAP string-union types with the repo’s typed-constant pattern.
Changes:
- Added
useWasapPageData.spec.tswith tests covering manual, resistance, variant (computed/predefined), untracked (custom/predefined), and covSpectrumCollection modes. - Exported
fetchWasapPageDatato enable direct unit testing without React Query hook setup. - Added typed constant objects (
WASAP_ANALYSIS_MODE,SIGNATURE_TYPE,EXCLUDE_SET_NAME,SEQUENCE_TYPE) and a newBackendRouteMocker.mockGetCollectionhelper.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| website/src/components/views/wasap/wasapPageConfig.ts | Introduces typed constant collections for analysis/config enums and adds SEQUENCE_TYPE. |
| website/src/components/views/wasap/useWasapPageData.ts | Exports fetchWasapPageData for direct unit testing and keeps hook behavior intact. |
| website/src/components/views/wasap/useWasapPageData.spec.ts | Adds comprehensive unit tests for all fetch modes plus getLapisFilterForTimeFrame. |
| website/routeMocker.ts | Adds mockGetCollection to support backend collection mocking in tests. |
fengelniederhammer
left a comment
Contributor
There was a problem hiding this comment.
A bunch of nits, looks good otherwise 👍
… customColumns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eFrame tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tasks
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.
Summary
useWasapPageData.spec.tswith 17 tests covering all 5 fetch modes: manual, resistance, variant (computed + predefined signatures), untracked (custom + predefined exclude sets), and covSpectrumCollection — including enabled, disabled, and error casesfetchWasapPageDatafor direct testing (avoids React QueryrenderHooksetup)BackendRouteMocker.mockGetCollectiontorouteMocker.tsSignatureType,WasapAnalysisMode, andExcludeSetNamefrom bare string unions to the const-object pattern (matchingVARIANT_TIME_FRAME), and addsSEQUENCE_TYPEfor the externalSequenceTypeTest plan
npx vitest run src/components/views/wasap/useWasapPageData.spec.ts— all 17 tests passnpx tsc --noEmit— no errors🤖 Generated with Claude Code