From 71e6eb025fa87f9267d7189a3a4efbc390298953 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 5 Nov 2024 00:24:24 +1100 Subject: [PATCH] [8.x] Fix tablelistview test due to timezone switch (#198759) (#198769) # Backport This will backport the following commits from `main` to `8.x`: - [Fix tablelistview test due to timezone switch (#198759)](https://github.com/elastic/kibana/pull/198759) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Anton Dosov --- .../table_list_view_table/src/table_list_view.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx index 38e05299184e4..38229399f2ec8 100644 --- a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx +++ b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx @@ -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,