Skip to content

Commit

Permalink
[8.16] Fix tablelistview test due to timezone switch (#198759) (#198768)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.16`:
- [Fix tablelistview test due to timezone switch
(#198759)](#198759)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Anton
Dosov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-04T11:39:05Z","message":"Fix
tablelistview test due to timezone switch (#198759)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/198744\r\n\r\nTest was
subtracting 7 days, but there is 1 hour less now, so the test\r\nsetup
is incorrect. Fixing it by using moment to handle time switch
edge\r\ncase","sha":"a88833c7830c2bb469430eb54c93cab19e64de6e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major"],"title":"Fix
tablelistview test due to timezone
switch","number":198759,"url":"https://github.com/elastic/kibana/pull/198759","mergeCommit":{"message":"Fix
tablelistview test due to timezone switch (#198759)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/198744\r\n\r\nTest was
subtracting 7 days, but there is 1 hour less now, so the test\r\nsetup
is incorrect. Fixing it by using moment to handle time switch
edge\r\ncase","sha":"a88833c7830c2bb469430eb54c93cab19e64de6e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198759","number":198759,"mergeCommit":{"message":"Fix
tablelistview test due to timezone switch (#198759)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/198744\r\n\r\nTest was
subtracting 7 days, but there is 1 hour less now, so the test\r\nsetup
is incorrect. Fixing it by using moment to handle time switch
edge\r\ncase","sha":"a88833c7830c2bb469430eb54c93cab19e64de6e"}}]}]
BACKPORT-->

Co-authored-by: Anton Dosov <[email protected]>
  • Loading branch information
kibanamachine and Dosant authored Nov 4, 2024
1 parent 287f535 commit 0f9cfea
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 0f9cfea

Please sign in to comment.