From 29177f1ec63a0e1466ff8b14e994a12c152f7f9e Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Mon, 26 Aug 2024 11:10:24 -0400 Subject: [PATCH] ref(js): Make widgetViewerModal.spec test compat across react-routers (#76541) --- .../app/components/modals/widgetViewerModal.spec.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/static/app/components/modals/widgetViewerModal.spec.tsx b/static/app/components/modals/widgetViewerModal.spec.tsx index d564136ebdb27a..00917f3475213f 100644 --- a/static/app/components/modals/widgetViewerModal.spec.tsx +++ b/static/app/components/modals/widgetViewerModal.spec.tsx @@ -575,10 +575,12 @@ describe('Modals -> WidgetViewerModal', function () { expect(eventsMock).toHaveBeenCalledTimes(1); expect(screen.getByText('title')).toBeInTheDocument(); await userEvent.click(screen.getByText('title')); - expect(initialData.router.push).not.toHaveBeenCalledWith({ - pathname: '/mock-pathname/', - query: {sort: ['-title']}, - }); + expect(initialData.router.push).not.toHaveBeenCalledWith( + expect.objectContaining({ + pathname: '/mock-pathname/', + query: {sort: ['-title']}, + }) + ); }); it('renders transaction summary link', async function () { @@ -750,6 +752,7 @@ describe('Modals -> WidgetViewerModal', function () { await userEvent.click(await screen.findByText('count()')); expect(initialData.router.push).toHaveBeenCalledWith( expect.objectContaining({ + pathname: '/mock-pathname/', query: {sort: ['-count()']}, }) );