Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: dotnet test --no-build --verbosity normal

frontend:
name: Frontend (React lint and build)
name: Frontend (React lint, test and build)
runs-on: ubuntu-latest

defaults:
Expand All @@ -62,5 +62,8 @@ jobs:
- name: Lint
run: npm run lint

- name: Test
run: npm test

- name: Build
run: npm run build
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,16 @@ The frontend is available at:
http://localhost:5173
```

The API base URL defaults to `http://localhost:5026`. To point the frontend at another API, copy `frontend/.env.example` to `frontend/.env.local` and set `VITE_API_BASE_URL`.

Run the frontend checks:

```bash
npm run lint
npm test
npm run build
```

---

# Seed Demo Data
Expand Down Expand Up @@ -1268,6 +1278,7 @@ Frontend job:

* installs dependencies with `npm ci`
* runs ESLint (`npm run lint`)
* runs the Vitest + React Testing Library tests (`npm test`)
* builds the production bundle (`npm run build`, including TypeScript type checking)

---
Expand Down Expand Up @@ -1305,6 +1316,19 @@ The solution currently includes 59 unit tests covering:
* Simulation candidate scoring logic
* Demo data seeding and reset support

## Frontend tests

The React dashboard has component tests with Vitest, React Testing Library and jsdom. `fetch` is stubbed with fixtures captured from the real API after `POST /api/demo/reset`, so no backend is needed.

They cover:

* Schedule overview rendering and Danish translation of risk indicators (including culture-independent coverage rates)
* Error page and retry when the API is unavailable
* Keeping the dashboard visible while refreshing after schedule generation
* Reloading employee preference profiles after a demo reset
* Weekly schedule placement per weekday, assigned/unassigned counts and filters
* Keeping the weekly schedule visible during refresh, plus error and retry

---

# Example Frontend Demo Flow
Expand Down
2 changes: 2 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Base URL of the ShiftPlanner API (defaults to http://localhost:5026)
VITE_API_BASE_URL=http://localhost:5026
Loading
Loading