From 52ecddc554d945bca1901568976aaef6dabdf2e6 Mon Sep 17 00:00:00 2001 From: phamhieu Date: Wed, 18 May 2022 11:51:28 +0700 Subject: [PATCH] fix: unit test missing dayjs extend --- studio/tests/pages/projects/LogEventChart.test.js | 7 ++++++- studio/tests/pages/projects/LogsPreviewer.test.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/studio/tests/pages/projects/LogEventChart.test.js b/studio/tests/pages/projects/LogEventChart.test.js index 4750a13f629..58f3862ada7 100644 --- a/studio/tests/pages/projects/LogEventChart.test.js +++ b/studio/tests/pages/projects/LogEventChart.test.js @@ -1,5 +1,10 @@ import LogEventChart from 'components/interfaces/Settings/Logs/LogEventChart' -import { render, waitFor, screen } from '@testing-library/react' +import { render, screen } from '@testing-library/react' + +import dayjs from 'dayjs' +import utc from 'dayjs/plugin/utc' + +dayjs.extend(utc) jest.mock('components/ui/Flag/Flag') import Flag from 'components/ui/Flag/Flag' diff --git a/studio/tests/pages/projects/LogsPreviewer.test.js b/studio/tests/pages/projects/LogsPreviewer.test.js index bb885579fa6..2c7ce95b3fa 100644 --- a/studio/tests/pages/projects/LogsPreviewer.test.js +++ b/studio/tests/pages/projects/LogsPreviewer.test.js @@ -1,3 +1,8 @@ +import dayjs from 'dayjs' +import utc from 'dayjs/plugin/utc' + +dayjs.extend(utc) + // mock the fetch function jest.mock('lib/common/fetch') import { get } from 'lib/common/fetch'