Skip to content

test(wasap): add tests for fetchWasapPageData#1332

Open
fhennig wants to merge 3 commits into
mainfrom
add-wasap-page-data-tests
Open

test(wasap): add tests for fetchWasapPageData#1332
fhennig wants to merge 3 commits into
mainfrom
add-wasap-page-data-tests

Conversation

@fhennig

@fhennig fhennig commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds useWasapPageData.spec.ts with 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 cases
  • Exports fetchWasapPageData for direct testing (avoids React Query renderHook setup)
  • Adds BackendRouteMocker.mockGetCollection to routeMocker.ts
  • Converts SignatureType, WasapAnalysisMode, and ExcludeSetName from bare string unions to the const-object pattern (matching VARIANT_TIME_FRAME), and adds SEQUENCE_TYPE for the external SequenceType

Test plan

  • npx vitest run src/components/views/wasap/useWasapPageData.spec.ts — all 17 tests pass
  • npx tsc --noEmit — no errors

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jul 13, 2026 9:07am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.ts with tests covering manual, resistance, variant (computed/predefined), untracked (custom/predefined), and covSpectrumCollection modes.
  • Exported fetchWasapPageData to 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 new BackendRouteMocker.mockGetCollection helper.

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.

Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts
Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts Outdated
Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts

@fengelniederhammer fengelniederhammer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A bunch of nits, looks good otherwise 👍

Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts
Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts Outdated
Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts Outdated
Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts
… customColumns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eFrame tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

3 participants