Skip to content

Commit

Permalink
update unit test input images
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshkumar1019 committed Nov 28, 2023
1 parent 4604524 commit 46c2f0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/UI/InputImage/InputImage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ jest.mock('./InputImage.messages', () => {
describe('InputImage tests', () => {
test('default render ', () => {
const onChange = jest.fn();
const wrapper = mount(<InputImage disabled={false} onChange={onChange} />);
const onLoad = jest.fn();
const wrapper = mount(<InputImage disabled={false} onChange={onChange} onLoad={onLoad}/>);
expect(wrapper).toMatchSnapshot();
});
test('on buttton click', () => {
const onChange = jest.fn();
const onLoad = jest.fn();
const event = {
target: {
files: [new File(['foo'], 'foo.txt')]
Expand All @@ -32,6 +34,7 @@ describe('InputImage tests', () => {
user={{ email: 'test' }}
disabled={false}
onChange={onChange}
onLoad={onLoad}
/>
);
wrapper.find('input').prop('onChange')(event);
Expand Down

0 comments on commit 46c2f0a

Please sign in to comment.