forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdomain-status.test.js
More file actions
75 lines (63 loc) · 2.36 KB
/
domain-status.test.js
File metadata and controls
75 lines (63 loc) · 2.36 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { StatusEnum } from '../../../enums'
import { domainStatus } from '../domain-status'
describe('given the domainStatus object', () => {
describe('testing its field definitions', () => {
it('has a dkim field', () => {
const demoType = domainStatus.getFields()
expect(demoType).toHaveProperty('dkim')
expect(demoType.dkim.type).toMatchObject(StatusEnum)
})
it('has a dmarc field', () => {
const demoType = domainStatus.getFields()
expect(demoType).toHaveProperty('dmarc')
expect(demoType.dmarc.type).toMatchObject(StatusEnum)
})
it('has a https field', () => {
const demoType = domainStatus.getFields()
expect(demoType).toHaveProperty('https')
expect(demoType.https.type).toMatchObject(StatusEnum)
})
it('has a spf field', () => {
const demoType = domainStatus.getFields()
expect(demoType).toHaveProperty('spf')
expect(demoType.spf.type).toMatchObject(StatusEnum)
})
it('has a ssl field', () => {
const demoType = domainStatus.getFields()
expect(demoType).toHaveProperty('ssl')
expect(demoType.ssl.type).toMatchObject(StatusEnum)
})
})
describe('testing its field resolvers', () => {
describe('testing the dkim resolver', () => {
it('returns the resolved value', () => {
const demoType = domainStatus.getFields()
expect(demoType.dkim.resolve({ dkim: 'pass' })).toEqual('pass')
})
})
describe('testing the dmarc resolver', () => {
it('returns the resolved value', () => {
const demoType = domainStatus.getFields()
expect(demoType.dmarc.resolve({ dmarc: 'pass' })).toEqual('pass')
})
})
describe('testing the https resolver', () => {
it('returns the resolved value', () => {
const demoType = domainStatus.getFields()
expect(demoType.https.resolve({ https: 'pass' })).toEqual('pass')
})
})
describe('testing the spf resolver', () => {
it('returns the resolved value', () => {
const demoType = domainStatus.getFields()
expect(demoType.spf.resolve({ spf: 'pass' })).toEqual('pass')
})
})
describe('testing the ssl resolver', () => {
it('returns the resolved value', () => {
const demoType = domainStatus.getFields()
expect(demoType.ssl.resolve({ ssl: 'pass' })).toEqual('pass')
})
})
})
})