|
|
|
@ -61,8 +61,9 @@ beforeEach(() => {
|
|
|
|
// Ensure database is initialized (recreates tables if dropped)
|
|
|
|
// Ensure database is initialized (recreates tables if dropped)
|
|
|
|
initializeDatabase(testDb);
|
|
|
|
initializeDatabase(testDb);
|
|
|
|
|
|
|
|
|
|
|
|
// Reset database state between tests
|
|
|
|
// Reset database state between tests (borrar raíz primero; ON DELETE CASCADE limpia assignments)
|
|
|
|
testDb.exec('DELETE FROM task_assignments');
|
|
|
|
testDb.exec('DELETE FROM response_queue');
|
|
|
|
|
|
|
|
try { testDb.exec('DELETE FROM task_origins'); } catch {}
|
|
|
|
testDb.exec('DELETE FROM tasks');
|
|
|
|
testDb.exec('DELETE FROM tasks');
|
|
|
|
testDb.exec('DELETE FROM users');
|
|
|
|
testDb.exec('DELETE FROM users');
|
|
|
|
testDb.exec('DELETE FROM groups');
|
|
|
|
testDb.exec('DELETE FROM groups');
|
|
|
|
|