Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dcmcand committed Feb 25, 2021
1 parent 0798506 commit af148bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const deleteFileModal = ({
}) => {
const onClose = () => {
onFileRemoved(index)
.then(closeModal());
.then(closeModal());
};
return (
<Modal
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/__tests__/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ describe('FileUploader', () => {
render(<FileUploader reportId="new" id="attachment" onChange={mockOnChange} files={[{ id: 1, originalFileName: 'fileOne' }, { id: 2, originalFileName: 'fileTwo' }]} />);
const fileTwo = screen.getByText('fileTwo');
fireEvent.click(fileTwo.parentNode.lastChild.firstChild);
const deleteButton = screen.getByText('Delete')
fireEvent.click(deleteButton)
const deleteButton = screen.getByText('Delete');
fireEvent.click(deleteButton);
expect(mockOnChange).toHaveBeenCalledWith([{ id: 1, originalFileName: 'fileOne' }]);
});
it('files are not removed if cancel is pressed', () => {
const mockOnChange = jest.fn();
render(<FileUploader reportId="new" id="attachment" onChange={mockOnChange} files={[{ id: 1, originalFileName: 'fileOne' }, { id: 2, originalFileName: 'fileTwo' }]} />);
const fileTwo = screen.getByText('fileTwo');
fireEvent.click(fileTwo.parentNode.lastChild.firstChild);
const cancelButton = screen.getByText('Cancel')
fireEvent.click(cancelButton)
const cancelButton = screen.getByText('Cancel');
fireEvent.click(cancelButton);
expect(mockOnChange).not.toHaveBeenCalled();
});
});
2 changes: 1 addition & 1 deletion frontend/src/fetchers/__tests__/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fetchMock.config.sendAsJson = true;
describe('File fetcher', () => {
beforeEach(() => fetchMock.reset());
it('test that the file gets uploaded', async () => {
fetchMock.postOnce(fileApiUrl, {id: 1});
fetchMock.postOnce(fileApiUrl, { id: 1 });
const res = await uploadFile(fakeFile);
expect(res.id).toBe(1);
});
Expand Down

0 comments on commit af148bc

Please sign in to comment.