EntityFilterType test

Signed-off-by: Victor Perera <v-vperera@expediagroup.com>
This commit is contained in:
Victor Perera
2021-10-08 17:36:25 -05:00
parent c120e220dd
commit fb5988d5d8
@@ -121,4 +121,27 @@ describe('<EntityTypePicker/>', () => {
expect(updateFilters).toHaveBeenLastCalledWith({ type: undefined });
});
it('respects the query parameter filter value', async () => {
const updateFilters = jest.fn();
const queryParameters = { type: 'tool' };
await renderWithEffects(
<ApiProvider apis={apis}>
<MockEntityListContextProvider
value={{
filters: { kind: new EntityKindFilter('component') },
updateFilters,
queryParameters,
}}
>
<EntityTypePicker initialFilter="tool" hidden />
</MockEntityListContextProvider>
,
</ApiProvider>,
);
expect(updateFilters).toHaveBeenLastCalledWith({
type: new EntityTypeFilter(['tool']),
});
});
});