2026-03-27 14:50:34 +09:00
|
|
|
import { describe, it, expect } from 'vitest';
|
2026-05-19 11:06:03 +09:00
|
|
|
import { UserModel } from '../../src/schemas/user.schema.js';
|
2026-03-27 14:50:34 +09:00
|
|
|
|
|
|
|
|
describe('UserModel', () => {
|
|
|
|
|
it('is a valid mongoose model', () => {
|
|
|
|
|
expect(UserModel.modelName).toBe('User');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has expected schema paths', () => {
|
|
|
|
|
const paths = Object.keys(UserModel.schema.paths);
|
|
|
|
|
expect(paths).toContain('keycloakId');
|
|
|
|
|
expect(paths).toContain('displayName');
|
|
|
|
|
expect(paths).toContain('email');
|
|
|
|
|
expect(paths).toContain('householdIds');
|
|
|
|
|
expect(paths).toContain('defaultHouseholdId');
|
|
|
|
|
expect(paths).toContain('createdAt');
|
|
|
|
|
expect(paths).toContain('updatedAt');
|
|
|
|
|
});
|
|
|
|
|
});
|