test(18): make timezone e2e deterministic and align with WR-01 fix
The timezone-verify spec assumed a first-run (unset) starting state, but e2e global-setup truncated only the list/event tables — never app_config — so a prior run's saved household_timezone leaked across runs. Clear that key in global-setup so the spec always starts from isExplicitlySet:false. Also repurpose the stale "Save disabled when unchanged" assertion: after the WR-01 fix, first-run Save is correctly ENABLED when the input matches the displayed default (saving confirms the detected zone). The disabled-when- unchanged-and-explicit case remains covered by the persist-across-reload test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
79ea94f4b9
commit
ddeb87cdba
@@ -109,6 +109,13 @@ export default async function globalSetup(): Promise<void> {
|
||||
await conn.execute('TRUNCATE TABLE calendar_events');
|
||||
await conn.execute('SET FOREIGN_KEY_CHECKS=1');
|
||||
|
||||
// Phase 18: clear any stored household timezone so the timezone spec always
|
||||
// starts from the first-run (isExplicitlySet:false) state. app_config is NOT
|
||||
// truncated above (it can hold other non-test config), so delete only this key.
|
||||
// Without this, a prior run's saved value leaks across runs and makes the
|
||||
// first-run / persist-across-reload timezone assertions non-deterministic.
|
||||
await conn.execute("DELETE FROM app_config WHERE `key` = 'household_timezone'");
|
||||
|
||||
// Seed the dev-bypass admin user row for id=1 (D-01 dev note, Phase 10).
|
||||
// DEV_USER (id=1) is injected by devBypass.ts WITHOUT a DB upsert, so the users table
|
||||
// has no row for id=1 by default. requireAdmin (Plan 02) does a DB lookup and would 403
|
||||
|
||||
Reference in New Issue
Block a user