diff --git a/src/web/entities/filterprovider.jsx b/src/web/entities/filterprovider.jsx index 689fdbf4bc..13a80ccacb 100644 --- a/src/web/entities/filterprovider.jsx +++ b/src/web/entities/filterprovider.jsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ - import React from 'react'; import Loading from 'web/components/loading/loading'; @@ -18,7 +17,7 @@ const FilterProvider = ({ pageName = gmpname, locationQuery = {}, }) => { - const [returnedFilter, isLoadingFilter] = usePageFilter(pageName, { + const [returnedFilter, isLoadingFilter] = usePageFilter(pageName, gmpname, { fallbackFilter, locationQueryFilterString: locationQuery?.filter, }); diff --git a/src/web/hooks/__tests__/usePageFilter.jsx b/src/web/hooks/__tests__/usePageFilter.jsx index 6f12833aa5..7d4d008b57 100644 --- a/src/web/hooks/__tests__/usePageFilter.jsx +++ b/src/web/hooks/__tests__/usePageFilter.jsx @@ -9,37 +9,25 @@ import {describe, test, expect, testing} from '@gsa/testing'; import Filter, {DEFAULT_FALLBACK_FILTER} from 'gmp/models/filter'; -import {fireEvent, rendererWith, screen} from 'web/utils/testing'; +import {rendererWith, waitFor} from 'web/utils/testing'; import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {defaultFilterLoadingActions} from 'web/store/usersettings/defaultfilters/actions'; import usePageFilter from '../usePageFilter'; import {pageFilter} from 'web/store/pages/actions'; +import {vi} from 'vitest'; -const TestComponent = ({fallbackFilter}) => { - const [filter, isLoadingFilter, changeFilter, removeFilter, resetFilter] = - usePageFilter('somePage', {fallbackFilter}); - return ( - <> - {isLoadingFilter ? ( -
Loading...
- ) : ( - <> -
{filter.toFilterString()}
-