Skip to content

Widen spacesState mock type to match spaces store#250

Merged
diocas merged 1 commit into
cernboxfrom
fix/pinia-spaces-mock-type
Jun 2, 2026
Merged

Widen spacesState mock type to match spaces store#250
diocas merged 1 commit into
cernboxfrom
fix/pinia-spaces-mock-type

Conversation

@Gerry-Cern
Copy link
Copy Markdown

Summary

PR #247 added loading-state tests to DriveRedirect.spec.ts that pass spacesInitialized and spacesLoading through the shared Pinia mock helper. However, the PiniaMockOptions.spacesState type in packages/web-test-helpers/src/mocks/pinia.ts only declared spaces and currentSpace, so vue-tsc rejected the extra properties with TS2353, breaking the type-check build after #247 merged.

This widens the spacesState mock type to match the real spaces Pinia store, which exposes spacesInitialized, mountPointsInitialized, and spacesLoading in addition to spaces and currentSpace. At runtime these values were already handled correctly (spread into initialState.spaces); only the type definition was out of date.

Changes

  • Extend PiniaMockOptions.spacesState with optional spacesInitialized, mountPointsInitialized, and spacesLoading fields.

Test plan

  • pnpm exec vitest run packages/web-app-files/tests/unit/views/spaces/DriveRedirect.spec.ts passes (2/2).
  • pnpm check:types no longer reports the TS2353 error on DriveRedirect.spec.ts / spacesState.
  • CI type-check and unit tests are green.

The spaces Pinia store exposes spacesInitialized, mountPointsInitialized and spacesLoading, but the shared PiniaMockOptions.spacesState test type only declared spaces and currentSpace. Tests passing the loading flags (e.g. DriveRedirect.spec.ts) were rejected by vue-tsc with TS2353.
@Gerry-Cern Gerry-Cern requested a review from diocas June 2, 2026 11:26
@diocas diocas merged commit 537d391 into cernbox Jun 2, 2026
@diocas diocas deleted the fix/pinia-spaces-mock-type branch June 2, 2026 12:10
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.

2 participants