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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:

defaults:
run:
working-directory: client

jobs:
build-and-test:
name: Lint, typecheck, build, test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: client/package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Typecheck & build
run: npm run build

- name: Test
run: npm test
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lerna-debug.log*
node_modules
dist
dist-ssr
coverage
*.local

# Editor directories and files
Expand Down
13 changes: 13 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ npm run dev

Requires the [Freighter](https://www.freighter.app/) browser extension to connect a Stellar wallet.

## Testing

Tests run on [Vitest](https://vitest.dev/) + [React Testing Library](https://testing-library.com/react), with `jsdom` as the DOM environment.

```bash
npm test # run the full suite once
npm run test:watch # watch mode for local development
npm run test:coverage # run with a v8 coverage report (text + html + lcov)
```

Test files live next to the code they cover (`*.test.ts` / `*.test.tsx`). Shared setup (currently just `@testing-library/jest-dom` matchers) lives in `src/test/setup.ts` and is wired in via `vite.config.ts`'s `test.setupFiles`.

## Data layer

`src/lib/api.ts` is a mock implementation of the documented `locka-api` provider endpoints (`GET /providers/{id}`, `POST /access-requests`, `GET /records`, `DELETE /access-grants/{id}`, `GET /audit-log`, etc.), backed by in-memory fixtures in `src/lib/mockData.ts`. Every function's signature mirrors the real endpoint shape, so swapping in real `fetch` calls against a live backend is a drop-in replacement — no component changes needed.
Expand All @@ -30,4 +42,5 @@ src/
hooks/ useWallet (Freighter connect/disconnect)
lib/ types, mock API client, mock data, formatting helpers
pages/ Dashboard, PatientSearch, RecordsPage, AccessManagement, AuditLog, ProviderProfile
test/ shared test setup (jest-dom matchers)
```
Loading
Loading