Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
- remove todos for mutations react query hooks
- use the favouriteFiltersJson to get the id
  • Loading branch information
joshuadkitenge committed Nov 20, 2024
1 parent 111d41f commit b7a1140
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions src/api/favouriteFilters.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ describe('favourite filters api functions', () => {

expect(result.current.data).toEqual('1');
});

it.todo(
'sends axios request to add favourite filters for a user and throws an appropriate error on failure'
);
});

describe('useEditFavouriteFilter', () => {
Expand All @@ -61,10 +57,6 @@ describe('favourite filters api functions', () => {

expect(result.current.data).toEqual('Updated 1');
});

it.todo(
'sends axios request to edit favourite filters for a user and throws an appropriate error on failure'
);
});

describe('useDeleteFavouriteFilter', () => {
Expand All @@ -82,9 +74,5 @@ describe('favourite filters api functions', () => {

expect(result.current.data).toEqual('');
});

it.todo(
'sends axios request to delete user favourite Filter and throws an appropriate error on failure'
);
});
});
2 changes: 1 addition & 1 deletion src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export const handlers = [
http.delete('/users/filters/:id', async ({ params }) => {
const { id } = params;

if (id === '66f2e06a41a3fe93d6c81395') {
if (id === favouriteFiltersJson[2]._id) {
return HttpResponse.json({ detail: 'error' }, { status: 400 });
}
return HttpResponse.json(undefined, { status: 204 });
Expand Down

0 comments on commit b7a1140

Please sign in to comment.