Skip to content

Commit dc30bff

Browse files
authored
test(react19): Adjust widgetViewerModal for react 19 (#87110)
1 parent 5c347fb commit dc30bff

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

static/app/components/modals/widgetViewerModal.spec.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,18 @@ describe('Modals -> WidgetViewerModal', function () {
411411
unselectedSeries: [`${mockWidget.id}:Query Name`],
412412
};
413413
await renderModal({initialData, widget: mockWidget});
414-
expect(ReactEchartsCore).toHaveBeenLastCalledWith(
414+
415+
const echartsMock = jest.mocked(ReactEchartsCore);
416+
const lastCall = echartsMock.mock.calls[echartsMock.mock.calls.length - 1]![0];
417+
// TODO(react19): Can change this back to expect(ReactEchartsCore).toHaveBeenLastCalledWith()
418+
expect(lastCall).toEqual(
415419
expect.objectContaining({
416420
option: expect.objectContaining({
417421
legend: expect.objectContaining({
418422
selected: {[`Query Name;${mockWidget.id}`]: false},
419423
}),
420424
}),
421-
}),
422-
{}
425+
})
423426
);
424427
});
425428

0 commit comments

Comments
 (0)