fix: locale time format mismatch

This commit is contained in:
asiaznik
2023-10-12 11:56:36 +02:00
parent daa737c0e4
commit 3f14580bbd
+8 -2
View File
@@ -104,7 +104,13 @@ describe('TradesTable', () => {
const [firstDateCell, secondDateCell] = createdAtCells;
// Compare the times as strings
expect(firstDateCell.textContent).toBe('6:59:00 PM');
expect(secondDateCell.textContent).toBe('7:00:00 PM');
// Note: I've changed it form literal strings to this because of the
// locale mismatch. Mocking the format also resulted with strange "space" diff.
expect(firstDateCell.textContent).toBe(
getTimeFormat().format(new Date(trade2.createdAt))
);
expect(secondDateCell.textContent).toBe(
getTimeFormat().format(new Date(trade.createdAt))
);
});
});