-
Notifications
You must be signed in to change notification settings - Fork 37
/
helpers.spec.js
36 lines (27 loc) · 927 Bytes
/
helpers.spec.js
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
import { divider, emailTo, smsTo, call } from '../../../ActionsMenu/Actions'
import { makeOptionalActions } from './helpers'
describe('makeOptionalActions', () => {
it('should return divider, call, smsTo, emailTo', () => {
const res = makeOptionalActions({
email: [{ address: 'mail@cozy.com' }],
phone: [{ number: '123456' }]
})
expect(res).toStrictEqual([divider, call, smsTo, emailTo])
})
it('should return divider, emailTo', () => {
const res = makeOptionalActions({
email: [{ address: 'mail@cozy.com' }]
})
expect(res).toStrictEqual([divider, emailTo])
})
it('should return divider, call, smsTo', () => {
const res = makeOptionalActions({
phone: [{ number: '123456' }]
})
expect(res).toStrictEqual([divider, call, smsTo])
})
it('should empty array', () => {
const res = makeOptionalActions({})
expect(res).toStrictEqual([])
})
})