This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/cypress/component/hooks/useForm/replaceEmptyStringInObjectToNull.cy.ts

21 lines
510 B
TypeScript

import { replaceEmptyStringInObjectToNull } from '../../../../hooks/useForm/replaceEmptyStringInObjectToNull'
describe('hooks/useForm/replaceEmptyStringInObjectToNull', () => {
it('should replace empty string in object to null except for required properties', () => {
expect(
replaceEmptyStringInObjectToNull(
{
foo: '',
bar: 'bar',
baz: ''
},
['baz']
)
).deep.equal({
foo: null,
bar: 'bar',
baz: ''
})
})
})