test: add Vitest projects, CI workflow, and new frontend/backend test suites - #789
Conversation
…superpowers Shell scripts checked out with CRLF on Windows (core.autocrlf=true) broke the Docker entrypoint at container start. Force LF for all text files at the git layer, matching the existing .editorconfig and Prettier settings.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Vitest infrastructure for Node and Playwright browser tests, shared SvelteKit mocks, server utility coverage, component tests, repository setup updates, and GitHub Actions execution. ChangesVitest testing infrastructure
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
| Filename | Overview |
|---|---|
| vite.config.ts | Adds separate Vitest projects for server tests and browser component tests. |
| src/lib/components/CopyButton.svelte.test.ts | Adds browser tests for clipboard writes, copied state, callback handling, and empty text. |
| src/lib/components/StatusBarCalendar.svelte.test.ts | Adds browser tests for calendar labeling and tooltip status output. |
| src/lib/server/tool.test.ts | Adds server-side unit tests for time helpers, validators, string helpers, secrets, alerts, and uptime calculations. |
| vitest-setup-client.ts | Adds shared SvelteKit runtime mocks for browser component tests. |
| .github/workflows/test.yml | Adds CI steps for dependency install, Playwright Chromium setup, type checking, and tests. |
| package.json | Adds test scripts and Vitest browser testing dependencies. |
Reviews (5): Last reviewed commit: "ci: cancel superseded test runs on the s..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/test.yml:
- Around line 13-14: Update the actions/checkout step to disable credential
persistence by setting persist-credentials to false, while leaving the existing
checkout action version unchanged.
- Around line 25-27: Update the “Get Playwright version” workflow step to query
the installed Playwright CLI for its version instead of reading the top-level
package-lock.json entry. Preserve the existing GitHub Actions output key,
playwright-version, so downstream steps continue receiving the version.
In `@src/lib/components/CopyButton.svelte.test.ts`:
- Line 24: Update the writeText assertion in the CopyButton test to use native
Vitest matchers: assert the argument with toHaveBeenCalledWith("copy-me") and
separately verify a single invocation with toHaveBeenCalledOnce().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 85cbbc3e-13a1-4f36-9bb8-5d2b5a39312f
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
.gitattributes.github/workflows/test.yml.gitignoreCLAUDE.mdpackage.jsonsrc/lib/components/CopyButton.svelte.test.tssrc/lib/components/StatusBarCalendar.svelte.test.tssrc/lib/server/tool.test.tsvite.config.tsvitest-setup-client.ts
Add a workflow-level concurrency group keyed by workflow + ref with cancel-in-progress, so pushing a new commit cancels the still-running test job for the previous commit on that branch/PR.
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
This repo lacked tests completely.
This MR adds, frontend and backend testing suits and each one real test with CI integration.
requires #787
Summary by CodeRabbit
Tests
Chores
Documentation