feat(ci): add frontend CI workflow and exclude UI tests from unit tests#23
Merged
Conversation
- Add .github/workflows/frontend-ci.yml to run unit and UI tests on push/PR - Update frontend/vite.config.ts to exclude src/ui-tests from Vitest - Ensure npm run test only runs unit tests - Ensure npm run test:ui runs Playwright component tests
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a dedicated GitHub Actions workflow to run the frontend’s unit (Vitest) and UI/component (Playwright CT) test suites on PRs and main-branch pushes, and updates the Vitest config so UI tests aren’t executed as part of unit tests.
Changes:
- Add
Frontend CIGitHub Actions workflow that runsnpm run testandnpm run test:ui, and uploads the Playwright HTML report artifact. - Update Vitest configuration to exclude
src/ui-testsfrom unit test runs. - Remove the “downloadFile returns a blob” unit test case from the API client tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
frontend/vite.config.ts |
Excludes ui-tests from Vitest to prevent Playwright specs from running as unit tests. |
frontend/src/api/__tests__/client.test.ts |
Removes one downloadFile success-path unit test (coverage impact). |
.github/workflows/frontend-ci.yml |
Adds a CI workflow to run unit + UI tests and upload Playwright report artifacts. |
Comments suppressed due to low confidence (1)
frontend/src/api/tests/client.test.ts:191
- This change removes the only “happy path” coverage for
apiClient.downloadFile(successfully returning a Blob). Consider restoring a success test (e.g., validating the returned blob’s type/size or decoded text) so regressions inhandleBlobResponse()aren’t missed while still keeping the existing error-case test.
it("downloadFile throws on error", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({detail: "Not found"}), {
status: 404,
statusText: "Not Found",
headers: {"content-type": "application/json"},
}),
);
const {apiClient} = await import("../client");
await expect(apiClient.downloadFile("/test")).rejects.toThrow(ApiError);
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.