Skip to content

Commit

Permalink
fix maybe flaky DB test
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Nov 29, 2024
1 parent dbef87e commit a9ebc5c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ describe('Database Backups', () => {

const { findByText, getAllByRole } = renderWithTheme(<DatabaseBackups />);

for (const backup of backups) {
const backupPromises = backups.map((backup) => {
const expectedDate = formatDate(backup.created, { timezone: 'utc' });
return findByText(expectedDate);
});

// eslint-disable-next-line no-await-in-loop
const backupItem = await findByText(expectedDate);

const backupElements = await Promise.all(backupPromises);
backupElements.forEach((backupItem) => {
expect(backupItem).toBeVisible();
}
});

// Verify there is a table row for each backup (and a row for the table header)
expect(getAllByRole('row')).toHaveLength(backups.length + 1);
Expand Down

0 comments on commit a9ebc5c

Please sign in to comment.