2026-03-28 08:19:48 +09:00
|
|
|
import { describe, it, expect } from 'vitest';
|
2026-05-19 11:06:03 +09:00
|
|
|
import { MedicineModel } from '../../src/schemas/medicine.schema.js';
|
2026-03-28 08:19:48 +09:00
|
|
|
|
|
|
|
|
describe(MedicineModel.name, () => {
|
|
|
|
|
it('is a valid mongoose model', () => {
|
|
|
|
|
expect(MedicineModel.modelName).toBe('Medicine');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has expected schema paths', () => {
|
|
|
|
|
const paths = Object.keys(MedicineModel.schema.paths);
|
|
|
|
|
expect(paths).toContain('householdId');
|
|
|
|
|
expect(paths).toContain('name');
|
|
|
|
|
expect(paths).toContain('form');
|
|
|
|
|
expect(paths).toContain('strength');
|
|
|
|
|
expect(paths).toContain('strengthUnit');
|
|
|
|
|
expect(paths).toContain('category');
|
|
|
|
|
expect(paths).toContain('tags');
|
|
|
|
|
expect(paths).toContain('createdBy');
|
|
|
|
|
expect(paths).toContain('isDeleted');
|
|
|
|
|
expect(paths).toContain('createdAt');
|
|
|
|
|
expect(paths).toContain('updatedAt');
|
|
|
|
|
});
|
|
|
|
|
});
|