@wmfs/json-to-vuelidate 1.22.3 → 1.23.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/CHANGELOG.md +15 -0
- package/package.json +5 -5
- package/test/test.js +22 -34
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [1.23.0](https://github.com/wmfs/json-to-vuelidate/compare/v1.22.3...v1.23.0) (2021-12-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### 🛠 Builds
|
|
5
|
+
|
|
6
|
+
* **deps-dev:** update dependency semantic-release to v18.0.1 ([4fed5c6](https://github.com/wmfs/json-to-vuelidate/commit/4fed5c6439b66e3de4d339f30954dcc9edb149ac))
|
|
7
|
+
* **deps-dev:** update semantic-release monorepo ([8ca62db](https://github.com/wmfs/json-to-vuelidate/commit/8ca62dbb892ff384edb65ee1936f82e324a851bb))
|
|
8
|
+
* **deps:** update dependency vuelidate to v0.7.7 ([aedd1af](https://github.com/wmfs/json-to-vuelidate/commit/aedd1af0bf754447ec98f35eaf09904cb0576e9d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### 🚨 Tests
|
|
12
|
+
|
|
13
|
+
* better labels for comparing min/max dates ([ccc5f43](https://github.com/wmfs/json-to-vuelidate/commit/ccc5f434c4ae9142ade2c7c62db7bf65a8915df9))
|
|
14
|
+
* enhance tests for min/max dates ([72ea867](https://github.com/wmfs/json-to-vuelidate/commit/72ea867adeaf4487927b33ae50fe894c6c030bb7))
|
|
15
|
+
|
|
1
16
|
## [1.22.3](https://github.com/wmfs/json-to-vuelidate/compare/v1.22.2...v1.22.3) (2021-10-27)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wmfs/json-to-vuelidate",
|
|
3
3
|
"description": "Takes in a JSON object and products an object of vuelidate expressions.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.23.0",
|
|
5
5
|
"author": "West Midlands Fire Service",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tymly",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"main": "./lib/index.js",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"vuelidate": "0.7.
|
|
12
|
+
"vuelidate": "0.7.7",
|
|
13
13
|
"lodash.template": "4.5.0",
|
|
14
14
|
"google-libphonenumber": "3.2.21",
|
|
15
15
|
"moment": "2.29.1"
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"cz-conventional-changelog": "3.3.0",
|
|
24
24
|
"mocha": "9.1.3",
|
|
25
25
|
"nyc": "15.1.0",
|
|
26
|
-
"semantic-release": "18.0.
|
|
26
|
+
"semantic-release": "18.0.1",
|
|
27
27
|
"standard": "16.0.4",
|
|
28
|
-
"@semantic-release/changelog": "6.0.
|
|
29
|
-
"@semantic-release/git": "10.0.
|
|
28
|
+
"@semantic-release/changelog": "6.0.1",
|
|
29
|
+
"@semantic-release/git": "10.0.1"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"lint": "standard",
|
package/test/test.js
CHANGED
|
@@ -76,41 +76,29 @@ describe('Test the vuelidate converter', function () {
|
|
|
76
76
|
expect(vuelidate.min3DaysAgo.minimumDate).to.be.a('function')
|
|
77
77
|
})
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
expect(tomorrowResult).to.eql(true)
|
|
79
|
+
const dates = [
|
|
80
|
+
['1 year ago', moment().subtract(1, 'year'), false, true],
|
|
81
|
+
['7 days ago', moment().subtract(7, 'day'), false, true],
|
|
82
|
+
['4 days ago', moment().subtract(4, 'day'), false, true],
|
|
83
|
+
['3 days ago', moment().subtract(3, 'day'), true, true],
|
|
84
|
+
['yesterday', moment().subtract(1, 'day'), true, true],
|
|
85
|
+
['today', moment(), true, true],
|
|
86
|
+
['tomorrow', moment().add(1, 'day'), true, false],
|
|
87
|
+
['3 days ahead', moment().add(3, 'day'), true, false],
|
|
88
|
+
['4 days ahead', moment().add(4, 'day'), true, false],
|
|
89
|
+
['7 days ahead', moment().add(7, 'day'), true, false],
|
|
90
|
+
['1 year ahead', moment().add(1, 'year'), true, false]
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
describe('Test the validation function for minimum date', () => {
|
|
94
|
+
for (const [label, date, minResult] of dates) {
|
|
95
|
+
it(`${label}, should${minResult ? '' : ' not'} be after 3 days ago`, () => expect(vuelidate.min3DaysAgo.minimumDate(date)).to.eql(minResult))
|
|
96
|
+
}
|
|
98
97
|
})
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const today = moment()
|
|
105
|
-
const tomorrow = moment().add(1, 'day')
|
|
106
|
-
|
|
107
|
-
const yesterdayResult = fn(yesterday)
|
|
108
|
-
expect(yesterdayResult).to.eql(true)
|
|
109
|
-
|
|
110
|
-
const todayResult = fn(today)
|
|
111
|
-
expect(todayResult).to.eql(true)
|
|
112
|
-
|
|
113
|
-
const tomorrowResult = fn(tomorrow)
|
|
114
|
-
expect(tomorrowResult).to.eql(false)
|
|
99
|
+
describe('Test the validation function for maximum date', () => {
|
|
100
|
+
for (const [label, date, , maxResult] of dates) {
|
|
101
|
+
it(`${label}, should${maxResult ? '' : ' not'} be before today`, () => expect(vuelidate.dateOfBirth.maximumDate(date)).to.eql(maxResult))
|
|
102
|
+
}
|
|
115
103
|
})
|
|
116
104
|
})
|