docs: bring README up to date; fix test type errors
- README: deployed behind Caddy and a shared password, party size (1-20), multi-date signup (up to 24), coordinator notices, migration rule now that production has applied migrations, D1/D2/D5 status, and a current "still unverified" list. - tests: type the shiftRows helper and the speculation-rules JSON so `tsc -p tsconfig.json` passes with no errors.
This commit is contained in:
1 parent
16ef47d8bf
commit
085f2dc668
3 files changed
+42
-19
No files matched your search
@@ -292,11 +292,13 @@ describe('public pages', () => {
|
||||
const rules = await app.request('/speculation-rules.json');
|
||||
expect(rules.status).toBe(200);
|
||||
expect(rules.headers.get('content-type')).toContain('application/speculationrules+json');
|
||||
const body = await rules.json();
|
||||
expect(body.prefetch[0].eagerness).toBe('moderate');
|
||||
expect(body.prefetch[0].where.and[1].not.selector_matches).toContain('[data-confirm]');
|
||||
expect(body.prefetch[0].where.and[1].not.selector_matches).toContain('[data-open-event]');
|
||||
expect(body.prefetch[0].where.and[1].not.selector_matches).toContain('[data-signup]');
|
||||
const body = (await rules.json()) as {
|
||||
prefetch: { eagerness: string; where: { and: { not: { selector_matches: string } }[] } }[];
|
||||
};
|
||||
expect(body.prefetch[0]!.eagerness).toBe('moderate');
|
||||
expect(body.prefetch[0]!.where.and[1]!.not.selector_matches).toContain('[data-confirm]');
|
||||
expect(body.prefetch[0]!.where.and[1]!.not.selector_matches).toContain('[data-open-event]');
|
||||
expect(body.prefetch[0]!.where.and[1]!.not.selector_matches).toContain('[data-signup]');
|
||||
});
|
||||
|
||||
it('prefixes routes and assets when the app is mounted at /volunteer', async () => {
|
||||
|
||||
+10
-2
@@ -243,13 +243,21 @@ function templateInput(overrides: Partial<{ weekday: number; role: string; capac
|
||||
};
|
||||
}
|
||||
|
||||
function shiftRows(db: Awaited<ReturnType<typeof openDb>>) {
|
||||
type ShiftRow = {
|
||||
occurrence_date: string | null;
|
||||
role: string;
|
||||
capacity: number;
|
||||
template_revision: number | null;
|
||||
cancelled: number;
|
||||
};
|
||||
|
||||
function shiftRows(db: Awaited<ReturnType<typeof openDb>>): ShiftRow[] {
|
||||
return db
|
||||
.prepare(
|
||||
`SELECT occurrence_date, role, capacity, template_revision, cancelled
|
||||
FROM shifts ORDER BY occurrence_date`,
|
||||
)
|
||||
.all();
|
||||
.all() as ShiftRow[];
|
||||
}
|
||||
|
||||
async function openDb() {
|
||||
|
||||
Reference in new issue
Block a user