chore: Vitest + Vue Test Utils test runner exposed as task test:web
This commit was merged in pull request #1.
This commit is contained in:
1 parent
64f50074bd
commit
24f95a8fd7
6 files changed
+286
-5
No files matched your search
@@ -0,0 +1,30 @@
|
||||
Feature: SPA test runner (Vitest + Vue Test Utils)
|
||||
|
||||
As the maintainer of RenewCMS
|
||||
I want a `task test:web` command that runs Vitest against the Vue 3 SPA
|
||||
So that SPA behaviour is verified by a real, automated test run instead of being reported as NOT RUN
|
||||
|
||||
Background:
|
||||
Given web/ has vitest and @vue/test-utils installed as devDependencies, added via bun
|
||||
And web/ has a Vitest config (jsdom environment) that discovers test files under web/src
|
||||
And Taskfile.yml defines a `test:web` task that installs frontend dependencies if needed and then runs the SPA test suite from the web/ directory in run (non-watch) mode
|
||||
|
||||
Scenario: A component test exists and exercises real component output
|
||||
Given web/src/views/HomeView.vue renders a paragraph with the text "Home"
|
||||
And a Vue Test Utils test mounts HomeView and asserts that the rendered text includes "Home"
|
||||
When `task test:web` is run
|
||||
Then the process exits with code 0
|
||||
And the output reports at least 1 passed test
|
||||
|
||||
Scenario: task test:web fails the build when a component assertion is wrong
|
||||
Given the HomeView component test instead asserts that the rendered text includes "Goodbye"
|
||||
When `task test:web` is run
|
||||
Then the process exits with a nonzero code
|
||||
And the output reports that test as failed, naming the file and the assertion that did not match
|
||||
|
||||
Scenario: task test:web runs standalone without the Go test suite or a built SPA
|
||||
Given internal/infrastructure/assets/dist/ does not exist (the SPA has not been built)
|
||||
And no Go test process is running
|
||||
When `task test:web` is run
|
||||
Then Vitest runs against web/src directly via Vite, with no dependency on the Go binary, the embedded dist/ assets or a live server
|
||||
And the command's exit code alone determines pass or fail
|
||||
Reference in new issue
Block a user