-
Notifications
You must be signed in to change notification settings - Fork 1
/
User.unit.ts
37 lines (30 loc) · 1 KB
/
User.unit.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { EntityID } from '../../../shared/domain/EntityID';
import { createUser } from '../../../shared/utils/test';
test('Create user with alias', () => {
const user = createUser({
username: 'test_username',
email: 'test+1@email.com',
alias: 'test_alias',
password: 'test_password',
});
expect(user.username.value).toBe('test_username');
expect(user.alias.value).toBe('test_alias');
expect(user.email.value).toBe('test+1@email.com');
expect(user.password.value).toBe('test_password');
});
test('Create user without alias', () => {
const user = createUser({
username: 'test_username',
email: 'test@email.com',
password: 'test_password',
});
expect(user.username.value).toBe('test_username');
expect(user.alias.value).toBe(null);
expect(user.email.value).toBe('test@email.com');
expect(user.password.value).toBe('test_password');
});
test('Create user with id', () => {
const id = new EntityID();
const user = createUser({ id });
expect(user.id).toBe(id);
});