Add additional lint rules
This commit is contained in:
parent
02d782c3da
commit
420b18eb78
67 changed files with 3686 additions and 1415 deletions
|
|
@ -23,22 +23,22 @@ describe(RefillsService.name, () => {
|
|||
getLatestForMedicine: vi.fn(),
|
||||
compareStores: vi.fn(),
|
||||
};
|
||||
const mockPurchasesRepo = {
|
||||
getPendingMedicineStock: vi.fn(),
|
||||
const mockShoppingListsRepo = {
|
||||
findActiveByHousehold: vi.fn(),
|
||||
};
|
||||
|
||||
let service: RefillsService;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
mockPurchasesRepo.getPendingMedicineStock.mockResolvedValue([]);
|
||||
mockShoppingListsRepo.findActiveByHousehold.mockResolvedValue([]);
|
||||
service = new RefillsService({
|
||||
refillsRepository: mockRepo as never,
|
||||
regimensService: mockRegimensService as never,
|
||||
cabinetRepository: mockCabinetRepo as never,
|
||||
cabinetService: mockCabinetService as never,
|
||||
medicinePricesRepository: mockPricesRepo as never,
|
||||
purchasesRepository: mockPurchasesRepo as never,
|
||||
shoppingListsRepository: mockShoppingListsRepo as never,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ describe(RefillsService.name, () => {
|
|||
expect(result[0].cheapestOption?.storeName).toBe('CVS');
|
||||
});
|
||||
|
||||
it('includes pendingOrderStock and daysUntilEmptyWithOrders from ordered purchases', async () => {
|
||||
it('includes pendingOrderStock and daysUntilEmptyWithOrders from active shopping lists', async () => {
|
||||
mockRegimensService.calculateBurnRates.mockResolvedValue([
|
||||
{
|
||||
medicineId: 'med-1',
|
||||
|
|
@ -151,8 +151,12 @@ describe(RefillsService.name, () => {
|
|||
mockCabinetRepo.getAggregateSummary.mockResolvedValue([]);
|
||||
mockPricesRepo.getLatestForMedicine.mockResolvedValue(null);
|
||||
mockPricesRepo.compareStores.mockResolvedValue([]);
|
||||
mockPurchasesRepo.getPendingMedicineStock.mockResolvedValue([
|
||||
{ medicineId: 'med-1', totalUnits: 60 },
|
||||
mockShoppingListsRepo.findActiveByHousehold.mockResolvedValue([
|
||||
{
|
||||
items: [
|
||||
{ productId: 'med-1', quantity: 60, checked: false },
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await service.getAlerts('hh1', 'user-1', 7);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue