Phase 5 cleanup
This commit is contained in:
parent
5536acd67d
commit
76a516a417
136 changed files with 6322 additions and 1985 deletions
|
|
@ -11,8 +11,13 @@ vi.mock('../api-client', () => ({
|
|||
}));
|
||||
|
||||
import {
|
||||
getRefillAlerts, listRefillLists, createRefillList, getRefillList,
|
||||
updateRefillList, updateRefillListItem, addToCabinet,
|
||||
getRefillAlerts,
|
||||
listRefillLists,
|
||||
createRefillList,
|
||||
getRefillList,
|
||||
updateRefillList,
|
||||
updateRefillListItem,
|
||||
addToCabinet,
|
||||
} from '../refills';
|
||||
|
||||
beforeEach(() => vi.clearAllMocks());
|
||||
|
|
@ -60,16 +65,17 @@ describe('refills service', () => {
|
|||
it('updateRefillList calls PATCH', async () => {
|
||||
mockPatch.mockResolvedValue({ _id: 'rl-1' });
|
||||
await updateRefillList('hh1', 'rl-1', { name: 'Updated' } as never);
|
||||
expect(mockPatch).toHaveBeenCalledWith('/households/hh1/refills/lists/rl-1', { name: 'Updated' });
|
||||
expect(mockPatch).toHaveBeenCalledWith('/households/hh1/refills/lists/rl-1', {
|
||||
name: 'Updated',
|
||||
});
|
||||
});
|
||||
|
||||
it('updateRefillListItem calls PATCH with nested path', async () => {
|
||||
mockPatch.mockResolvedValue({ _id: 'rl-1' });
|
||||
await updateRefillListItem('hh1', 'rl-1', 'item-1', { purchased: true } as never);
|
||||
expect(mockPatch).toHaveBeenCalledWith(
|
||||
'/households/hh1/refills/lists/rl-1/items/item-1',
|
||||
{ purchased: true },
|
||||
);
|
||||
expect(mockPatch).toHaveBeenCalledWith('/households/hh1/refills/lists/rl-1/items/item-1', {
|
||||
purchased: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('addToCabinet calls POST with empty body', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue