From e76b7e24d900ff1214d0869ab4fa6effb2e92f9b Mon Sep 17 00:00:00 2001 From: ahmadshaheer Date: Sun, 22 Dec 2024 16:57:31 +0430 Subject: [PATCH] fix: fix the failing tests --- frontend/src/pages/TracesExplorer/Filter/Filter.tsx | 2 +- .../pages/TracesExplorer/__test__/TracesExplorer.test.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/TracesExplorer/Filter/Filter.tsx b/frontend/src/pages/TracesExplorer/Filter/Filter.tsx index d0e1f0ef51..c4ee2dba5a 100644 --- a/frontend/src/pages/TracesExplorer/Filter/Filter.tsx +++ b/frontend/src/pages/TracesExplorer/Filter/Filter.tsx @@ -204,7 +204,7 @@ export function Filter(props: FilterProps): JSX.Element { }); } - if (isEqual(currentQuery, preparedQuery)) { + if (isEqual(currentQuery, preparedQuery) && !props?.resetAll) { return; } redirectWithQueryBuilderData(preparedQuery); diff --git a/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx b/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx index c4fdf588de..d5e89feb20 100644 --- a/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx +++ b/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx @@ -109,6 +109,13 @@ jest.mock('container/OptionsMenu/useOptionsMenu', () => ({ default: (): any => optionMenuReturn, })); +jest.mock('react-redux', () => ({ + ...jest.requireActual('react-redux'), + useSelector: (): any => ({ + loading: false, + }), +})); + describe('TracesExplorer - Filters', () => { // Initial filter panel rendering // Test the initial state like which filters section are opened, default state of duration slider, etc.