Commit 1e020a5
authored
feat: add comprehensive test suite with Vitest and Playwright (#16)
* feat: add comprehensive test suite with Vitest and Playwright
Add testing infrastructure for the application:
- Configure Vitest with separate configs for main and renderer processes
- Add React Testing Library for component testing
- Set up Playwright for E2E testing
- Create test setup files with mocks for Electron APIs
Test coverage includes:
- Renderer hooks: useDebounce, useKeyboardEvent, useKeyboardShortcuts
- Contexts: Settings, Theme, Update, Breadcrumb
- Components: DataTable, NewPatientForm
- Main process: repository tests (structure only, requires Electron env)
- Integration tests (structure only, requires Electron env)
- E2E tests with Playwright (skipped by default)
Update CI workflow to run tests before build.
* fix: correct test schemas and CI workflow order
- Fix activity.test.ts: use camelCase properties (entityType, surgeryId) and
correct action types ('created'/'updated' instead of 'create'/'update')
- Fix patient.test.ts: use correct schema (phn, birth_year, gender)
- Fix dashboard.test.ts: use correct patient/surgery schema
- Fix surgery.test.ts: use correct schema (title, bht, ward instead of procedure)
- Fix surgery-template.test.ts: use title instead of name
- Fix app-settings.test.ts: handle possibly undefined results
- Fix backup.test.ts: add type annotation for array
- Fix NewPatientForm.test.tsx: use Date objects for created_at/updated_at
- Fix renderer-setup.ts: import beforeEach from vitest
- Update tsconfig.web.json: add jest-dom types
- Update CI workflow: run tests after lint and typecheck1 parent 9e2ff2b commit 1e020a5
File tree
40 files changed
+7299
-2
lines changed- .github/workflows
- src
- main
- __tests__
- repository/__tests__
- renderer/src
- components
- patient/__tests__
- ui/data-table/__tests__
- contexts/__tests__
- hooks/__tests__
- tests
- e2e
- fixtures
- helpers
- integration
- setup
40 files changed
+7299
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| 106 | + | |
98 | 107 | | |
99 | 108 | | |
100 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| 118 | + | |
| 119 | + | |
106 | 120 | | |
107 | 121 | | |
108 | 122 | | |
| |||
111 | 125 | | |
112 | 126 | | |
113 | 127 | | |
| 128 | + | |
114 | 129 | | |
115 | 130 | | |
116 | 131 | | |
117 | 132 | | |
118 | 133 | | |
119 | 134 | | |
120 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
121 | 138 | | |
122 | 139 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments