Skip to content

test: cover template page hydration#204

Open
taherdhanera wants to merge 5 commits into
outerbase:mainfrom
taherdhanera:test-template-page-coverage-71
Open

test: cover template page hydration#204
taherdhanera wants to merge 5 commits into
outerbase:mainfrom
taherdhanera:test-template-page-coverage-71

Conversation

@taherdhanera
Copy link
Copy Markdown

@taherdhanera taherdhanera commented May 13, 2026

/claim #71

Fixes #71.

Summary

  • Add focused Vitest coverage for the interface template page entrypoint.
  • Cover the no-root guard so the module does not hydrate when #root[data-client="template"] is absent.
  • Cover the positive hydration path and assert hydrateRoot receives the server root.
  • Add a non-overlapping interface primitive coverage slice for Avatar fallback/image states, Card anchor/div variants, Label required validation messaging, Loader sizing, Toggle size/selected classes, and Input prefix/suffix, invalid state, sizing, and custom class handling.
  • Add public package entrypoint coverage for the root runtime API (StarbaseDB, StarbaseDBDurableObject) and documented plugin barrel exports.
  • Add JSON import route coverage for malformed application/json payload shapes, invalid uploaded JSON files, column mapping inserts, and valid multipart JSON file imports.
  • Assert malformed JSON import requests return the existing 400 validation response without calling executeOperation.

Validation

  • pnpm exec vitest --run src/import/json.test.ts src/public-entrypoints.test.ts plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> 22 tests passed
  • pnpm exec prettier --check src/import/json.test.ts src/public-entrypoints.test.ts plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> passed
  • git diff --check -> passed

Note: I also ran the current full coverage command, pnpm exec vitest --run --coverage.enabled true --coverage.reporter=text; the baseline currently fails in existing src/rls/index.test.ts assertions before this change. This PR's focused tests pass locally.

@taherdhanera
Copy link
Copy Markdown
Author

Pushed follow-up commit ede6342 with a second non-overlapping interface coverage slice.

Additional coverage now includes Avatar fallback/image states, Card anchor/div variants, Label required validation messaging, Loader sizing/classes, and Toggle size/selected classes. This stays separate from the existing Button/Select and InterfacePlugin route-registration coverage work.

Focused validation passes:

  • pnpm exec vitest --run plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> 2 files passed, 7 tests passed
  • pnpm exec prettier --check plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx
  • git diff --check

@taherdhanera
Copy link
Copy Markdown
Author

Pushed one more focused coverage commit (a85df98) adding Input primitive assertions for prefix/suffix rendering, invalid state styling, sizing, and custom classes.

Verification rerun:

  • pnpm exec vitest --run plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> 8 tests passed
  • pnpm exec prettier --check plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> passed
  • git diff --check -> passed

@taherdhanera
Copy link
Copy Markdown
Author

Pushed another focused coverage commit (8496c2f) adding public package entrypoint tests:

  • root runtime API exports: StarbaseDB, StarbaseDBDurableObject
  • plugin barrel exports: Studio, WebSocket, SQL macros, Stripe, CDC, Query Log, Resend, and Clerk plugins

Verification rerun:

  • pnpm exec vitest --run src/public-entrypoints.test.ts plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> 10 tests passed
  • pnpm exec prettier --check src/public-entrypoints.test.ts plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> passed
  • git diff --check -> passed

@taherdhanera
Copy link
Copy Markdown
Author

Pushed follow-up commit 52c8424 with another non-overlapping coverage slice for JSON imports.

Additional coverage now includes:

  • malformed application/json payload shapes where data is missing, null, or not an array
  • invalid uploaded JSON files
  • column mapping insert SQL/params
  • valid multipart JSON file import
  • assertions that malformed payloads return the existing 400 validation response without calling executeOperation

Verification rerun:

  • pnpm exec vitest --run src/import/json.test.ts src/public-entrypoints.test.ts plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> 22 tests passed
  • pnpm exec prettier --check src/import/json.test.ts src/public-entrypoints.test.ts plugins/interface/pages/template/index.test.tsx plugins/interface/components/primitives.test.tsx -> passed
  • git diff --check -> passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve test coverage with Vitest

1 participant