@defra-fish/business-rules-lib 1.26.0-rc.9 → 1.26.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/business-rules-lib",
|
|
3
|
-
"version": "1.26.0
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Shared business rules for the rod licensing digital services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"moment": "^2.29.1",
|
|
38
38
|
"uuid": "^8.3.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "fd5ea7ee779ca63c2b4b56cc89c0383c72fd08ec"
|
|
41
41
|
}
|
|
@@ -304,8 +304,8 @@ describe('contact validators', () => {
|
|
|
304
304
|
})
|
|
305
305
|
|
|
306
306
|
it('throws where the premises exceeds the maximum allowed length', async () => {
|
|
307
|
-
await expect(contactValidation.createPremisesValidator(Joi).validateAsync('A'.repeat(
|
|
308
|
-
'"value" length must be less than or equal to
|
|
307
|
+
await expect(contactValidation.createPremisesValidator(Joi).validateAsync('A'.repeat(51))).rejects.toThrow(
|
|
308
|
+
'"value" length must be less than or equal to 50 characters long'
|
|
309
309
|
)
|
|
310
310
|
})
|
|
311
311
|
})
|
|
@@ -109,8 +109,7 @@ export const createMobilePhoneValidator = joi => joi.string().trim().pattern(mob
|
|
|
109
109
|
* @param {Joi.Root} joi the joi validator used by the consuming project
|
|
110
110
|
* @returns {Joi.StringSchema}
|
|
111
111
|
*/
|
|
112
|
-
export const createPremisesValidator = joi =>
|
|
113
|
-
joi.string().trim().min(1).max(100).external(toTitleCase()).required().example('Example House')
|
|
112
|
+
export const createPremisesValidator = joi => joi.string().trim().min(1).max(50).external(toTitleCase()).required().example('Example House')
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
115
|
* Create a validator to check a contact's address street
|