Tests refactor
This commit is contained in:
parent
245520fb50
commit
99134d8556
165 changed files with 911 additions and 531 deletions
19
packages/api/tests/schemas/user.schema.test.ts
Normal file
19
packages/api/tests/schemas/user.schema.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { UserModel } from '../../src/schemas/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