From 22f4c97c1bbf5d009a2b51279ebfeb2e73d9b2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ir=C3=A9n=C3=A9e?= Date: Wed, 26 Nov 2025 10:42:37 +0000 Subject: [PATCH] fix: Fix bad written snapshot test (no-changelog) --- .../components/InsightsSummary.test.ts | 17 ++---- .../InsightsSummary.test.ts.snap | 57 ++----------------- 2 files changed, 12 insertions(+), 62 deletions(-) diff --git a/packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.test.ts b/packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.test.ts index a83524cb22f..ce74a6cfe78 100644 --- a/packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.test.ts +++ b/packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.test.ts @@ -4,7 +4,7 @@ import { createComponentRenderer } from '@/__tests__/render'; import type { InsightsSummaryDisplay } from '@/features/execution/insights/insights.types'; import { createTestingPinia } from '@pinia/testing'; import { defaultSettings } from '@/__tests__/defaults'; -import { getLocalTimeZone, today } from '@internationalized/date'; +import { CalendarDate, getLocalTimeZone, today } from '@internationalized/date'; vi.mock('vue-router', () => ({ useRouter: () => ({}), @@ -181,17 +181,12 @@ describe('InsightsSummary', () => { }, }, { - description: 'custom range ending today', + description: 'custom range', getDates: () => { - const end = today(getLocalTimeZone()); - return { start: end.subtract({ days: 15 }), end }; - }, - }, - { - description: 'custom range not ending today', - getDates: () => { - const end = today(getLocalTimeZone()).subtract({ days: 2 }); - return { start: end.subtract({ days: 7 }), end }; + return { + start: new CalendarDate(2025, 9, 6), + end: new CalendarDate(2025, 9, 13), + }; }, }, ])('should render with $description', ({ getDates }) => { diff --git a/packages/frontend/editor-ui/src/features/execution/insights/components/__snapshots__/InsightsSummary.test.ts.snap b/packages/frontend/editor-ui/src/features/execution/insights/components/__snapshots__/InsightsSummary.test.ts.snap index da1559a8c6d..8eb7fccbe49 100644 --- a/packages/frontend/editor-ui/src/features/execution/insights/components/__snapshots__/InsightsSummary.test.ts.snap +++ b/packages/frontend/editor-ui/src/features/execution/insights/components/__snapshots__/InsightsSummary.test.ts.snap @@ -213,85 +213,40 @@ exports[`InsightsSummary > should render the summary correctly 6`] = ` " `; -exports[`InsightsSummary > with different date ranges > should render with 'custom range ending today' 1`] = ` +exports[`InsightsSummary > with different date ranges > should render with 'custom range' 1`] = ` "
-
" -`; - -exports[`InsightsSummary > with different date ranges > should render with 'custom range not ending today' 1`] = ` -"