2026-03-28 08:19:48 +09:00
|
|
|
import { describe, it, expect } from 'vitest';
|
2026-05-19 11:06:03 +09:00
|
|
|
import { MedicineProductModel } from '../../src/schemas/medicine-product.schema.js';
|
2026-03-28 08:19:48 +09:00
|
|
|
|
|
|
|
|
describe(MedicineProductModel.name, () => {
|
|
|
|
|
it('is a valid mongoose model', () => {
|
|
|
|
|
expect(MedicineProductModel.modelName).toBe('MedicineProduct');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has expected schema paths', () => {
|
|
|
|
|
const paths = Object.keys(MedicineProductModel.schema.paths);
|
|
|
|
|
expect(paths).toContain('householdId');
|
|
|
|
|
expect(paths).toContain('medicineId');
|
|
|
|
|
expect(paths).toContain('medicineName');
|
|
|
|
|
expect(paths).toContain('brand');
|
|
|
|
|
expect(paths).toContain('packageSize');
|
|
|
|
|
expect(paths).toContain('packageUnit');
|
|
|
|
|
expect(paths).toContain('source');
|
|
|
|
|
expect(paths).toContain('createdBy');
|
|
|
|
|
expect(paths).toContain('isDeleted');
|
|
|
|
|
expect(paths).toContain('createdAt');
|
|
|
|
|
expect(paths).toContain('updatedAt');
|
|
|
|
|
});
|
|
|
|
|
});
|