Skip to content

Commit

Permalink
refactor: updated index.test to resolve failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
BilalQamar95 committed Apr 24, 2024
1 parent c764205 commit 700c76e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/data/selectors/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ describe('root selectors', () => {
});
});
describe('if neither/only 1 are default values', () => {
beforeEach(() => {
filterConstants.filterConfig[filterName] = testConfig;
config = selectors.root.filterBadgeConfig(testState, filterName);
});
describe.each([
['neither', () => false],
['only filter1', (v) => v === filters[0]],
['only filter2', (v) => v === filters[1]],
], '%1 is default', (label, isDefaultFn) => {
beforeEach(() => {
filterConstants.filterConfig[filterName] = testConfig;
config = selectors.root.filterBadgeConfig(testState, filterName);
});

it('returns isDefault: false, string value, and remaining filterConfig', () => {
selectors.filters.isDefault.mockImplementation(isDefaultFn);
const { filterOrder, ...rest } = testConfig;
Expand Down

0 comments on commit 700c76e

Please sign in to comment.