diff --git a/src/__tests__/analytics.test.ts b/src/__tests__/analytics.test.ts index e8621b5..f24dd11 100644 --- a/src/__tests__/analytics.test.ts +++ b/src/__tests__/analytics.test.ts @@ -25,7 +25,7 @@ describe("analytics", () => { window.addEventListener(ANALYTICS_EVENTS.BOOKING_STEP_SERVICE, listener); fireAnalyticsEvent(ANALYTICS_EVENTS.BOOKING_STEP_SERVICE, { step: "service", flow: "public" }); expect(listener).toHaveBeenCalledTimes(1); - const event = listener.mock.calls[0][0] as CustomEvent; + const event = listener.mock.calls[0]![0] as CustomEvent; expect(event.type).toBe("booking_step_service"); expect(event.detail.step).toBe("service"); expect(event.detail.flow).toBe("public"); @@ -37,7 +37,7 @@ describe("analytics", () => { const listener = vi.fn(); window.addEventListener(ANALYTICS_EVENTS.BOOKING_CONFIRMED, listener); fireAnalyticsEvent(ANALYTICS_EVENTS.BOOKING_CONFIRMED, { step: "confirmed", flow: "public" }); - const event = listener.mock.calls[0][0] as CustomEvent; + const event = listener.mock.calls[0]![0] as CustomEvent; expect(event.detail.timestamp).toBeTruthy(); expect(new Date(event.detail.timestamp as string)).toBeInstanceOf(Date); window.removeEventListener(ANALYTICS_EVENTS.BOOKING_CONFIRMED, listener);