Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-19506 Fix attaching files on devices with touch events #3996

Merged
merged 2 commits into from
Oct 21, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Make better test for touch event
  • Loading branch information
enahum committed Oct 18, 2019
commit c55b6b9ba0898b3998a019ff387984c8ca813e3a
9 changes: 5 additions & 4 deletions components/file_upload/file_upload.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ describe('components/FileUpload', () => {
const wrapper = shallowWithIntl(
<FileUpload {...baseProps}/>
);

wrapper.instance().fileInput = {
const instance = wrapper.instance();
instance.handleLocalFileUploaded = jest.fn();
instance.fileInput = {
current: {
click: () => baseProps.onClick(),
click: () => instance.handleLocalFileUploaded(),
},
};
wrapper.find('button').simulate('touchend');
expect(baseProps.onClick).toHaveBeenCalledTimes(1);
expect(instance.handleLocalFileUploaded).toHaveBeenCalledTimes(1);
});

test('should match state and call handleMaxUploadReached or props.onClick on handleLocalFileUploaded', () => {
Expand Down