Skip to content

Commit

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

Fix elastic#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
  • Loading branch information
Dosant authored Nov 4, 2024
1 parent e945fc9 commit a88833c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,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 a88833c

Please sign in to comment.