Skip to content

Commit

Permalink
fix linting and unit tests #1075
Browse files Browse the repository at this point in the history
  • Loading branch information
asuresh-code committed Jan 14, 2025
1 parent 3f4e8db commit 0cc1b3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/editFileDialog.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('Edit file dialog', () => {
await user.click(saveButton);

expect(axiosPatchSpy).toHaveBeenCalledWith('/images/1', {
file_name: 'test_file_name.jpeg',
file_name: 'test_file_name.jpeg.png',
title: 'Test Title',
description: 'Test Description',
});
Expand Down
4 changes: 2 additions & 2 deletions src/common/editFileDialog.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const EditFileDialog = (props: FileDialogProps) => {

const selectedFileCopy: ObjectFilePatch = React.useMemo(
() => (selectedFile ? { ...selectedFile, file_name: initialName } : {}),
[selectedFile]
[selectedFile, initialName]
);

const initialFile: ObjectFilePatch = React.useMemo(
Expand Down Expand Up @@ -109,7 +109,7 @@ const EditFileDialog = (props: FileDialogProps) => {

const isTitleUpdated = fileData.title !== selectedFileCopy.title;

let fileToEdit: ObjectFilePatch = {};
const fileToEdit: ObjectFilePatch = {};

if (isFileNameUpdated)
fileToEdit.file_name = fileData.file_name + extension;
Expand Down
2 changes: 1 addition & 1 deletion src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ export const handlers = [

const fullBody = { ...obj, ...body };

if (fullBody.file_name === 'Error 500') {
if (fullBody.file_name === 'Error 500.png') {
return HttpResponse.json(
{ detail: 'Something went wrong' },
{ status: 500 }
Expand Down

0 comments on commit 0cc1b3a

Please sign in to comment.