Skip to content

Commit

Permalink
Fix tablelistview test due to timezone switch (#198759)
Browse files Browse the repository at this point in the history
## Summary

Fix #198744

Test was subtracting 7 days, but there is 1 hour less now, so the test
setup is incorrect. Fixing it by using moment to handle time switch edge
case

(cherry picked from commit a88833c)
  • Loading branch information
Dosant committed Nov 4, 2024
1 parent de26287 commit 86966ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ describe('TableListView', () => {
const updatedAtValues: Moment[] = [];

const updatedHits = hits.map(({ id, attributes, references }, i) => {
const updatedAt = new Date(new Date().setDate(new Date().getDate() - (7 + i)));
updatedAtValues.push(moment(updatedAt));
const updatedAt = moment().subtract(7 + i, 'days');
updatedAtValues.push(updatedAt);

return {
id,
Expand Down

0 comments on commit 86966ce

Please sign in to comment.