Move the 200ms delay to before the add call

This ensures that a new timestamp is created after the initial call to `addOrUpdateParkingStructure`
This commit is contained in:
2025-07-03 15:40:14 -04:00
parent 5f982fe182
commit 7c359dd775

View File

@@ -175,10 +175,10 @@ describe.each(repositoryImplementations)('$name', (holder) => {
{ ...testStructure, spotsAvailable: 60, updatedTime: new Date() },
];
// Add updates with small delays to ensure different timestamps
for (let i = 0; i < updates.length; i++) {
await repository.addOrUpdateParkingStructure(updates[i]);
// Ensure that different timestamps are created, even after adding the first test structure
await new Promise((resolve) => setTimeout(resolve, 200));
await repository.addOrUpdateParkingStructure(updates[i]);
}
const now = Date.now();