-
Notifications
You must be signed in to change notification settings - Fork 9
/
attendee.test.ts
43 lines (37 loc) · 1.03 KB
/
attendee.test.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
38
39
40
41
42
43
import Answer from './answer';
import Attendee from './attendee';
it('can set answers when providing a single answer', async () => {
const answer = new Answer;
const attendee = new Attendee;
expect(attendee.answers(answer).getAttributes()).toEqual(
expect.objectContaining({
answers: [answer],
})
);
});
it('can set answers when providing multiple answers', async () => {
const answer = new Answer;
const attendee = new Attendee;
expect(attendee.answers([answer, answer]).getAttributes()).toEqual(
expect.objectContaining({
answers: [answer, answer],
})
);
});
it('can set location detail parameters and maintain existing attributes', async () => {
const attendee = new Attendee;
const details = {
address: '123 Fake St',
city: 'Fake City',
country: 'FC',
postcode: 'X0X 0X0',
region: 'FR',
timezone: 'UTC',
};
expect(attendee.located(details).getAttributes()).toEqual(
expect.objectContaining({
...attendee.getAttributes(),
...details
})
);
});