From 3f14580bbd2f4ee3c57e7339ac54ddcff1d70712 Mon Sep 17 00:00:00 2001 From: asiaznik Date: Thu, 12 Oct 2023 11:56:36 +0200 Subject: [PATCH] fix: locale time format mismatch --- libs/trades/src/lib/trades-table.spec.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/trades/src/lib/trades-table.spec.tsx b/libs/trades/src/lib/trades-table.spec.tsx index e06faa0de..dd81c53bf 100644 --- a/libs/trades/src/lib/trades-table.spec.tsx +++ b/libs/trades/src/lib/trades-table.spec.tsx @@ -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)) + ); }); });