Phase 5 cleanup
This commit is contained in:
parent
5536acd67d
commit
76a516a417
136 changed files with 6322 additions and 1985 deletions
|
|
@ -12,8 +12,15 @@ vi.mock('../api-client', () => ({
|
|||
}));
|
||||
|
||||
import {
|
||||
listMedicines, getMedicine, createMedicine, updateMedicine, deleteMedicine,
|
||||
listMedicineProducts, createMedicineProduct, updateMedicineProduct, deleteMedicineProduct,
|
||||
listMedicines,
|
||||
getMedicine,
|
||||
createMedicine,
|
||||
updateMedicine,
|
||||
deleteMedicine,
|
||||
listMedicineProducts,
|
||||
createMedicineProduct,
|
||||
updateMedicineProduct,
|
||||
deleteMedicineProduct,
|
||||
} from '../medicines';
|
||||
|
||||
beforeEach(() => vi.clearAllMocks());
|
||||
|
|
@ -77,13 +84,17 @@ describe('medicines service', () => {
|
|||
it('createMedicineProduct calls POST', async () => {
|
||||
mockPost.mockResolvedValue({ _id: 'mp-1' });
|
||||
await createMedicineProduct('hh1', 'med-1', { brand: 'Bayer' } as never);
|
||||
expect(mockPost).toHaveBeenCalledWith('/households/hh1/medicines/med-1/products', { brand: 'Bayer' });
|
||||
expect(mockPost).toHaveBeenCalledWith('/households/hh1/medicines/med-1/products', {
|
||||
brand: 'Bayer',
|
||||
});
|
||||
});
|
||||
|
||||
it('updateMedicineProduct uses medicine-products path', async () => {
|
||||
mockPatch.mockResolvedValue({ _id: 'mp-1' });
|
||||
await updateMedicineProduct('hh1', 'mp-1', { brand: 'Updated' } as never);
|
||||
expect(mockPatch).toHaveBeenCalledWith('/households/hh1/medicine-products/mp-1', { brand: 'Updated' });
|
||||
expect(mockPatch).toHaveBeenCalledWith('/households/hh1/medicine-products/mp-1', {
|
||||
brand: 'Updated',
|
||||
});
|
||||
});
|
||||
|
||||
it('deleteMedicineProduct calls DELETE', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue