feat: add admin password reset

This commit is contained in:
2026-06-16 06:40:55 -06:00
parent 502afffa02
commit 979a70439b
8 changed files with 168 additions and 6 deletions

View File

@@ -226,6 +226,18 @@ In `src/components/AdminPage.test.ts`, update the import line:
import { beforeEach, describe, expect, it, vi } from 'vitest'
```
Update `beforeEach()` so one-shot mock responses from reset tests cannot leak into later tests:
```ts
beforeEach(() => {
authedFetch.mockReset()
logout.mockReset()
authedFetch.mockResolvedValue([
{ id: 'u1', username: 'teacher', role: 'user', createdAt: '2026-01-01T00:00:00.000Z' },
])
})
```
Append these tests inside `describe('AdminPage', () => { ... })`:
```ts