test(consumables): Implement unit tests to validate inventory logic, consumption tracking, and validation in ConsumableItemService

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-03-25 23:20:00 -07:00
parent f6e8d8a5e4
commit d2a111059d

View file

@ -7,10 +7,14 @@ import { ConsumableItem } from '../entities/consumable-item.entity';
import { ConsumableLog } from '../entities/consumable-log.entity';
import { mockRepository, MockRepository } from '@test-helpers/mock-repository';
import { makeConsumableItem, makeConsumableItemLog } from '@test-helpers/factories';
import { ProjectResolverService } from '@features/projects/backend/project-resolver.service';
import { ProjectResolverService } from '@projects/productivity/projects/backend/project-resolver.service';
import { mockProjectResolverService, MockProjectResolverService } from '@test-helpers/mock-project-resolver';
import { ConsumableFrequency } from '@life-platform/shared';
jest.mock('@common/resolve-short-id', () => ({
resolveShortId: jest.fn(async (_repo: unknown, id: string) => id),
}));
describe('ConsumableItemService', () => {
let service: ConsumableItemService;
let scheduleRepo: MockRepository;