Skip to content

test(#233): establish web-package test harness + characterization tests#238

Open
husamql3 wants to merge 1 commit into
stagefrom
test/#233-web-test-harness
Open

test(#233): establish web-package test harness + characterization tests#238
husamql3 wants to merge 1 commit into
stagefrom
test/#233-web-test-harness

Conversation

@husamql3

@husamql3 husamql3 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added a runnable Vitest + Testing Library harness to packages/web — the package had no vitest dependency and no test script, so its single existing test could not run. Adds the devDependencies, vitest.config.ts (happy-dom env + @ alias), tests/setup.ts, and test/test:watch scripts. Root bun run test now runs the web suite alongside the server suite via Turbo (no CI change needed).
  • Added characterization tests for high-risk pure logic — extended the bulk-data parser tests and added tests for cell-value formatting (incl. the circular-reference fallback that guards against a render crash) and the overlay store's stack transitions. No application source changed.
  • Reviewer note: this commit also refreshes bun.lockbun install reconciled pre-existing manifest/lock drift (portless, vite, @tanstack/*) beyond the four test deps. Not arbitrary (the manifests already declared those ranges), but if you prefer a lockfile-clean PR, reset bun.lock to base and re-add only the test devDependencies.

Testing

  1. cd packages/web && bun run test → 54 tests pass across 3 files
  2. bun run test (root) → server (997) + web (54) all pass
  3. bun run typecheck, bun run format → pass

Closes #233

Glossary

Term Definition
Vitest The test runner used across this repo (the server package already uses it).
happy-dom A lightweight DOM implementation used as the Vitest test environment.
Characterization test A test that pins existing behaviour so future refactors can't change it unnoticed.

- Add vitest, @testing-library/{react,jest-dom,user-event}, and happy-dom
  devDependencies plus `test`/`test:watch` scripts to the web package so the
  previously-orphaned test file can run and CI picks the web suite up.
- Create vitest.config.ts (happy-dom env, `@`/`@db-studio/shared` aliases) and
  tests/setup.ts (Testing Library matchers + afterEach cleanup).
- Extend parse-bulk-data.test.ts with JSON/CSV edge cases (malformed JSON,
  quoted delimiters, semicolon detection, leading-zero preservation,
  header-only input, blank-line handling).
- Add format-cell-value.test.ts (nullish, primitives, object serialization,
  circular-ref fallback) and overlay.store.test.ts (open/close/toggle/query
  state transitions).
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@husamql3, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fd7403b5-fc8a-4cbd-b99c-f5433763bab0

📥 Commits

Reviewing files that changed from the base of the PR and between b86b1de and fb4f92d.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • packages/web/package.json
  • packages/web/src/stores/overlay.store.test.ts
  • packages/web/src/utils/format-cell-value.test.ts
  • packages/web/src/utils/parse-bulk-data.test.ts
  • packages/web/tests/setup.ts
  • packages/web/vitest.config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/#233-web-test-harness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bundle Size

packages/server/dist788K

File breakdown
172K	packages/server/dist/index.js
612K	packages/server/dist/index.js.map

packages/web/dist64M

File breakdown
4.0K	packages/web/dist/assets/_pathlessLayout-BULBsQ9r.js
4.0K	packages/web/dist/assets/_pathlessLayout-BULBsQ9r.js.map
56K	packages/web/dist/assets/_pathlessLayout-Dfl7cEzS.js
1.2M	packages/web/dist/assets/_pathlessLayout-Dfl7cEzS.js.map
4.0K	packages/web/dist/assets/_queryId-BMnw4ion.js
4.0K	packages/web/dist/assets/_queryId-BMnw4ion.js.map
4.0K	packages/web/dist/assets/_table-CjzZjPMC.js
4.0K	packages/web/dist/assets/_table-CjzZjPMC.js.map
4.0K	packages/web/dist/assets/_table-j9zpjAmw.js
4.0K	packages/web/dist/assets/_table-j9zpjAmw.js.map
28K	packages/web/dist/assets/bundle-mjs-BC_8HrWA.js
140K	packages/web/dist/assets/bundle-mjs-BC_8HrWA.js.map
444K	packages/web/dist/assets/chunk-BO2N2NFS-D1cKzRy7.js
1.7M	packages/web/dist/assets/chunk-BO2N2NFS-D1cKzRy7.js.map
8.0K	packages/web/dist/assets/code-editor-D1LiAEIU.js
20K	packages/web/dist/assets/code-editor-D1LiAEIU.js.map
120K	packages/web/dist/assets/codicon-ngg6Pgfi.ttf
1.3M	packages/web/dist/assets/css.worker-A3810hic.js
3.2M	packages/web/dist/assets/css.worker-A3810hic.js.map
36K	packages/web/dist/assets/dist-m8A6NETj.js
88K	packages/web/dist/assets/dist-m8A6NETj.js.map
56K	packages/web/dist/assets/format-cell-value-BDLw73u3.js
232K	packages/web/dist/assets/format-cell-value-BDLw73u3.js.map
4.0K	packages/web/dist/assets/highlighted-body-OFNGDK62-NogKB3ej.js
4.0K	packages/web/dist/assets/highlighted-body-OFNGDK62-NogKB3ej.js.map
860K	packages/web/dist/assets/html.worker-DUbSWKmN.js
2.2M	packages/web/dist/assets/html.worker-DUbSWKmN.js.map
20K	packages/web/dist/assets/icons-B5bSDd0r.js
88K	packages/web/dist/assets/icons-B5bSDd0r.js.map
124K	packages/web/dist/assets/index-B-VrElCM.css
464K	packages/web/dist/assets/index-jUSdFX4o.js
2.0M	packages/web/dist/assets/index-jUSdFX4o.js.map
4.0K	packages/web/dist/assets/indexes-CBb_pYf_.js
4.0K	packages/web/dist/assets/indexes-CBb_pYf_.js.map
12K	packages/web/dist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2
12K	packages/web/dist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2
16K	packages/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2
40K	packages/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2
8.0K	packages/web/dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2
516K	packages/web/dist/assets/json.worker-qcFW0tBA.js
1.7M	packages/web/dist/assets/json.worker-qcFW0tBA.js.map
4.0K	packages/web/dist/assets/logs-BDeicfXz.js
4.0K	packages/web/dist/assets/logs-BDeicfXz.js.map
4.0K	packages/web/dist/assets/mermaid-GHXKKRXX-kUDCGRaV.js
4.1M	packages/web/dist/assets/monaco-editor-DJLWokZr.js
15M	packages/web/dist/assets/monaco-editor-DJLWokZr.js.map
140K	packages/web/dist/assets/monaco-editor-DVSAlpqy.css
200K	packages/web/dist/assets/monitoring-Dw3KwoPJ.js
512K	packages/web/dist/assets/monitoring-Dw3KwoPJ.js.map
4.0K	packages/web/dist/assets/queries.store-7xsfz1PY.js
8.0K	packages/web/dist/assets/queries.store-7xsfz1PY.js.map
12K	packages/web/dist/assets/query-runner-CXVau1Wg.js
32K	packages/web/dist/assets/query-runner-CXVau1Wg.js.map
148K	packages/web/dist/assets/radix-ui-DS4zDRqg.js
672K	packages/web/dist/assets/radix-ui-DS4zDRqg.js.map
176K	packages/web/dist/assets/react-dom-DafrnciU.js
784K	packages/web/dist/assets/react-dom-DafrnciU.js.map
4.0K	packages/web/dist/assets/rolldown-runtime-b3L32Ng1.js
4.0K	packages/web/dist/assets/runner-BcvbPtrn.js
4.0K	packages/web/dist/assets/runner-BcvbPtrn.js.map
4.0K	packages/web/dist/assets/schema-4dGwYfjY.js
4.0K	packages/web/dist/assets/schema-4dGwYfjY.js.map
4.0K	packages/web/dist/assets/table-voW5jQda.js
4.0K	packages/web/dist/assets/table-voW5jQda.js.map
276K	packages/web/dist/assets/tanstack-BfO3BbGk.js
1.1M	packages/web/dist/assets/tanstack-BfO3BbGk.js.map
7.8M	packages/web/dist/assets/ts.worker-BmSK7P1D.js
17M	packages/web/dist/assets/ts.worker-BmSK7P1D.js.map
4.0K	packages/web/dist/assets/visualizer-s3AQxGwZ.js
4.0K	packages/web/dist/assets/visualizer-s3AQxGwZ.js.map
104K	packages/web/dist/image.png
4.0K	packages/web/dist/index.html

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.

test(web): establish a web-package test harness + characterization tests

1 participant