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

(cherry picked from commit a88833c)
  • Loading branch information
Dosant committed Nov 4, 2024
1 parent 287f535 commit eb3c6b6
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 eb3c6b6

Please sign in to comment.