Setup initial project
This commit is contained in:
commit
db79af06f7
119 changed files with 20761 additions and 0 deletions
19
packages/api/src/schemas/user.schema.test.ts
Normal file
19
packages/api/src/schemas/user.schema.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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');
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue