Skip to content

Commit

Permalink
Add fix to test
Browse files Browse the repository at this point in the history
  • Loading branch information
vashjs committed Nov 7, 2023
1 parent 62fdd88 commit 606eb12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/QueryBuilder/QueryBuilder/helpers/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const mongoQueryToSource = async ({
intl,
getParamsSource,
}) => {
if (!fieldOptions?.length) return [];
if (!fieldOptions?.length || !Object.keys(initialValues).length) return [];

const key = Object.keys(initialValues)[0];
const sharedArgs = { intl, booleanOptions, getParamsSource, fieldOptions };
Expand Down
1 change: 1 addition & 0 deletions src/QueryBuilder/QueryBuilder/helpers/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('mongoQueryToSource()', () => {
booleanOptions,
fieldOptions,
intl: { formatMessage: jest.fn() },
getParamsSource: jest.fn(),
});

expect(result).toEqual([]);
Expand Down

0 comments on commit 606eb12

Please sign in to comment.