mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
fixed GenericInput tests
This commit is contained in:
parent
57c80e7f47
commit
f723fa36c2
@ -111,13 +111,15 @@ describe('GenericInput', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('does call onChange callback with null on empty value', () => {
|
||||
test('does call onChange callback with undefined on empty value', () => {
|
||||
const spy = jest.fn();
|
||||
const { input } = setupNumber({ value: 1, onChange: spy });
|
||||
|
||||
fireEvent.change(input, { target: { value: '' } });
|
||||
|
||||
expect(spy).toHaveBeenCalledWith({ target: { name: 'number', type: 'number', value: null } });
|
||||
expect(spy).toHaveBeenCalledWith({
|
||||
target: { name: 'number', type: 'number', value: undefined },
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user