From ff763d5492b5c8d8b679ea55c46d32ba636fd9f9 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Wed, 4 Oct 2023 17:41:05 -0400 Subject: [PATCH] [OSCI] [FIX] time conversion unit test bug (#5174) * fix time conversion test bug * Fix wrong test case --------- Signed-off-by: Thanh Signed-off-by: Anan Zhuang Signed-off-by: Miki Co-authored-by: Anan Zhuang Co-authored-by: Miki Co-authored-by: Sean Neumann <1413295+seanneumann@users.noreply.github.com> Signed-off-by: Willie Hung --- CHANGELOG.md | 2 +- .../application/components/chart/utils/point_series.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e60c9cb01909..86874fd9d83a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,9 +63,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fix errors in conditions for activating `vizAugmenter` ([#5213](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5213)) - [Data Explorer][Discover] Automatically load solo added default index pattern ([#5171](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5171)) - [Data Explorer][Discover] Allow data grid to auto adjust size based on fetched data count ([#5191](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5191)) +- [BUG] Fix wrong test due to time conversion ([#5174](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5174)) - [BUG][Data Explorer][Discover] Allow filter and query persist when refresh page or paste url to a new tab ([#5206](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5206)) - ### 🚞 Infrastructure - Re-enable CI workflows for feature branches ([#2908](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2908)) diff --git a/src/plugins/discover/public/application/components/chart/utils/point_series.test.ts b/src/plugins/discover/public/application/components/chart/utils/point_series.test.ts index b7a8ab2bfd43..2ad671e6fda8 100644 --- a/src/plugins/discover/public/application/components/chart/utils/point_series.test.ts +++ b/src/plugins/discover/public/application/components/chart/utils/point_series.test.ts @@ -51,8 +51,8 @@ describe('buildPointSeriesData', () => { expect(result.ordered.interval.asHours()).toBe(1); expect(result.ordered.intervalOpenSearchUnit).toBe('h'); expect(result.ordered.intervalOpenSearchValue).toBe(1); - expect(result.ordered.min.format()).toBe('2023-01-01T00:00:00+00:00'); - expect(result.ordered.max.format()).toBe('2023-01-02T00:00:00+00:00'); + expect(result.ordered.min.format()).toBe(moment('2023-01-01T00:00:00+00:00').format()); + expect(result.ordered.max.format()).toBe(moment('2023-01-02T00:00:00+00:00').format()); expect(result.yAxisLabel).toEqual('Y Axis'); expect(result.values).toEqual([ { x: 10, y: 100 },