@defra-fish/sales-api-service 1.64.0 → 1.65.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/sales-api-service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.65.0-rc.0",
|
|
4
4
|
"description": "Rod Licensing Sales API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@defra-fish/business-rules-lib": "1.
|
|
39
|
-
"@defra-fish/connectors-lib": "1.
|
|
40
|
-
"@defra-fish/dynamics-lib": "1.
|
|
38
|
+
"@defra-fish/business-rules-lib": "1.65.0-rc.0",
|
|
39
|
+
"@defra-fish/connectors-lib": "1.65.0-rc.0",
|
|
40
|
+
"@defra-fish/dynamics-lib": "1.65.0-rc.0",
|
|
41
41
|
"@hapi/boom": "9.1.2",
|
|
42
42
|
"@hapi/hapi": "20.1.3",
|
|
43
43
|
"@hapi/inert": "6.0.3",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"moment-timezone": "0.5.34",
|
|
53
53
|
"uuid": "8.3.2"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "cdf9253964871c4afe0ff85d085364ffe4e890cf"
|
|
56
56
|
}
|
|
@@ -43,6 +43,8 @@ describe('authenticate handler', () => {
|
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
describe('authenticateRenewal', () => {
|
|
46
|
+
const baseUrl = '/authenticate/renewal/CD379B?licenseeBirthDate=2000-01-01&licenseePostcode=AB123CD'
|
|
47
|
+
|
|
46
48
|
it('authenticates a renewal request', async () => {
|
|
47
49
|
executeQuery.mockResolvedValueOnce([
|
|
48
50
|
{
|
|
@@ -63,7 +65,7 @@ describe('authenticate handler', () => {
|
|
|
63
65
|
executeQuery.mockResolvedValueOnce([{ entity: MOCK_CONCESSION_PROOF_ENTITY, expanded: { concession: { entity: MOCK_CONCESSION } } }])
|
|
64
66
|
const result = await server.inject({
|
|
65
67
|
method: 'GET',
|
|
66
|
-
url:
|
|
68
|
+
url: baseUrl
|
|
67
69
|
})
|
|
68
70
|
expect(result.statusCode).toBe(200)
|
|
69
71
|
expect(JSON.parse(result.payload)).toMatchObject({
|
|
@@ -104,7 +106,7 @@ describe('authenticate handler', () => {
|
|
|
104
106
|
it('should call contactForLicenseeNoReference with dob and postcode for a renewal request', async () => {
|
|
105
107
|
await server.inject({
|
|
106
108
|
method: 'GET',
|
|
107
|
-
url:
|
|
109
|
+
url: baseUrl
|
|
108
110
|
})
|
|
109
111
|
expect(contactForLicenseeNoReference).toHaveBeenCalledWith('2000-01-01', 'AB12 3CD')
|
|
110
112
|
})
|
|
@@ -112,7 +114,7 @@ describe('authenticate handler', () => {
|
|
|
112
114
|
it('should call permissionForContacts with contact ids from contactForLicenseeNoReference', async () => {
|
|
113
115
|
await server.inject({
|
|
114
116
|
method: 'GET',
|
|
115
|
-
url:
|
|
117
|
+
url: baseUrl
|
|
116
118
|
})
|
|
117
119
|
expect(permissionForContacts).toHaveBeenCalledWith([MOCK_EXISTING_CONTACT_ENTITY.id])
|
|
118
120
|
})
|
|
@@ -120,7 +122,7 @@ describe('authenticate handler', () => {
|
|
|
120
122
|
it('returns 200 from a renewal request', async () => {
|
|
121
123
|
const result = await server.inject({
|
|
122
124
|
method: 'GET',
|
|
123
|
-
url:
|
|
125
|
+
url: baseUrl
|
|
124
126
|
})
|
|
125
127
|
expect(result.statusCode).toBe(200)
|
|
126
128
|
})
|
|
@@ -128,7 +130,7 @@ describe('authenticate handler', () => {
|
|
|
128
130
|
it('returns permission from a renewal request', async () => {
|
|
129
131
|
const result = await server.inject({
|
|
130
132
|
method: 'GET',
|
|
131
|
-
url:
|
|
133
|
+
url: baseUrl
|
|
132
134
|
})
|
|
133
135
|
expect(JSON.parse(result.payload)).toMatchObject({
|
|
134
136
|
permission: expect.objectContaining({
|
|
@@ -151,7 +153,7 @@ describe('authenticate handler', () => {
|
|
|
151
153
|
const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(jest.fn())
|
|
152
154
|
const result = await server.inject({
|
|
153
155
|
method: 'GET',
|
|
154
|
-
url:
|
|
156
|
+
url: baseUrl
|
|
155
157
|
})
|
|
156
158
|
expect(result.statusCode).toBe(500)
|
|
157
159
|
expect(JSON.parse(result.payload)).toMatchObject({
|
|
@@ -173,7 +175,7 @@ describe('authenticate handler', () => {
|
|
|
173
175
|
executeQuery.mockResolvedValueOnce([])
|
|
174
176
|
const result = await server.inject({
|
|
175
177
|
method: 'GET',
|
|
176
|
-
url:
|
|
178
|
+
url: baseUrl
|
|
177
179
|
})
|
|
178
180
|
expect(result.statusCode).toBe(401)
|
|
179
181
|
expect(JSON.parse(result.payload)).toMatchObject({
|
|
@@ -187,7 +189,7 @@ describe('authenticate handler', () => {
|
|
|
187
189
|
executeQuery.mockResolvedValueOnce([])
|
|
188
190
|
const result = await server.inject({
|
|
189
191
|
method: 'GET',
|
|
190
|
-
url:
|
|
192
|
+
url: baseUrl
|
|
191
193
|
})
|
|
192
194
|
expect(result.statusCode).toBe(401)
|
|
193
195
|
expect(JSON.parse(result.payload)).toMatchObject({
|