mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
5156313074
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
22 lines
735 B
TypeScript
22 lines
735 B
TypeScript
import type { User } from '@/databases/entities/user';
|
|
import type { PublicUser } from '@/interfaces';
|
|
|
|
export const validateUser = (user: PublicUser) => {
|
|
expect(typeof user.id).toBe('string');
|
|
expect(user.email).toBeDefined();
|
|
expect(user.firstName).toBeDefined();
|
|
expect(user.lastName).toBeDefined();
|
|
expect(typeof user.isOwner).toBe('boolean');
|
|
expect(user.isPending).toBe(false);
|
|
expect(user.signInType).toBe('email');
|
|
expect(user.settings).toBe(null);
|
|
expect(user.personalizationAnswers).toBeNull();
|
|
expect(user.password).toBeUndefined();
|
|
expect(user.role).toBeDefined();
|
|
};
|
|
|
|
export type UserInvitationResult = {
|
|
user: Pick<User, 'id' | 'email'> & { inviteAcceptUrl: string; emailSent: boolean };
|
|
error?: string;
|
|
};
|