20 lines
631 B
TypeScript
20 lines
631 B
TypeScript
|
|
import { describe, it, expect } from 'vitest';
|
||
|
|
import { UserModel } from './user.schema.js';
|
||
|
|
|
||
|
|
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');
|
||
|
|
});
|
||
|
|
});
|