From 8eb936f46f10c60194d991ca780d9489c074d161 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 13 Sep 2026 21:25:07 +0200 Subject: [PATCH] fix(test): the places e2e knows the table the delete path reads Deleting a place cancels the nights booked at it, and that query hits `day_accommodations`. This file builds its own minimal schema and did not have the table, so every delete answered 500 and three cases failed. The assignments e2e was given it for the same reason; this one was missed. This is the failure that has been keeping Server Coverage red on dev. --- server/tests/e2e/places.e2e.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/tests/e2e/places.e2e.test.ts b/server/tests/e2e/places.e2e.test.ts index 0055ab99a..74942e403 100644 --- a/server/tests/e2e/places.e2e.test.ts +++ b/server/tests/e2e/places.e2e.test.ts @@ -44,6 +44,11 @@ const { db } = vi.hoisted(() => { tmp.exec(`CREATE TABLE day_assignments (id INTEGER PRIMARY KEY AUTOINCREMENT, day_id INTEGER NOT NULL, place_id INTEGER NOT NULL, order_index INTEGER DEFAULT 0);`); // reclaimPlaceImage ref-counts an uploaded thumbnail across both tables. + // Deleting a place cancels the nights booked at it (#2354), so the delete path + // reads this table even in a file that never books one. + tmp.exec(`CREATE TABLE day_accommodations (id INTEGER PRIMARY KEY AUTOINCREMENT, trip_id INTEGER, + place_id INTEGER, start_day_id INTEGER, end_day_id INTEGER, check_in TEXT, check_in_end TEXT, + check_out TEXT, confirmation TEXT, notes TEXT, created_at TEXT DEFAULT (datetime('now')));`); tmp.exec(`CREATE TABLE collection_places (id INTEGER PRIMARY KEY AUTOINCREMENT, image_url TEXT);`); // reclaimPhotoCache's removeIfUnreferenced sweeps the Google photo cache. tmp.exec(`CREATE TABLE google_place_photo_meta (place_id TEXT PRIMARY KEY, attribution TEXT, error_at DATETIME);`);