Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ncovercash committed Dec 13, 2024
1 parent 20c153f commit 1bff3e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
export default function upgradeInitialValues(initialValues, entityType) {
if (!initialValues) {
return initialValues;
return undefined;
}

const withoutVersion = { ...initialValues };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ describe('initial values legacy conversion', () => {
[undefined, undefined],
[null, {}],
[undefined, {}],
[{}, null],
[{}, undefined],
])('ignores initialValues=%s and entityType=%s', (initialValues, entityType) => {
expect(upgradeInitialValues(initialValues, entityType)).toStrictEqual(initialValues);
[{ _version: '1' }, null],
[{ _version: '1' }, undefined],
[{ _version: '1' }, null],
[{ _version: '1' }, undefined],
[{ _version: '1' }, {}],
])('considers initialValues=%s and entityType=%s as a new query', (initialValues, entityType) => {
expect(upgradeInitialValues(initialValues, entityType)).toStrictEqual(undefined);
});

it.each([{}, { foo: '' }, { bar: '' }, { foo: '', bar: '' }])(
it.each([{ foo: '' }, { bar: '' }, { foo: '', bar: '' }])(
'processes but does not convert non-id columns in %s',
(values) => {
expect(upgradeInitialValues(values, ENTITY_TYPE)).toStrictEqual(values);
Expand Down

0 comments on commit 1bff3e5

Please sign in to comment.