@itfin/components 2.0.21 → 2.0.22

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": "@itfin/components",
3
- "version": "2.0.21",
3
+ "version": "2.0.22",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -183,7 +183,7 @@ export function dateSameOrBeforeValidation (dateCompare, message) {
183
183
  };
184
184
  }
185
185
 
186
- export function validatePassword(message) {
186
+ export function passwordValidation(message) {
187
187
  return (v, $t) => {
188
188
  return !isEmpty(v) && PASSWORD_REGEX.test(v.trim() + '') || (message || $t('components.passwordValidation'));
189
189
  };
@@ -7,7 +7,7 @@ import {
7
7
  dateAfterValidation,
8
8
  dateSameOrAfterValidation,
9
9
  dateSameOrBeforeValidation,
10
- validatePassword,
10
+ passwordValidation,
11
11
  } from './validators';
12
12
 
13
13
  describe('Validators', () => {
@@ -84,15 +84,15 @@ describe('Validators', () => {
84
84
  });
85
85
 
86
86
 
87
- test('validatePassword', () => {
88
- expect(validatePassword()('', $t)).toEqual('components.passwordValidation');
89
- expect(validatePassword()(' ', $t)).toEqual('components.passwordValidation');
90
- expect(validatePassword()(null, $t)).toEqual('components.passwordValidation');
91
- expect(validatePassword()(undefined, $t)).toEqual('components.passwordValidation');
92
- expect(validatePassword()(' тесттест ', $t)).toEqual('components.passwordValidation');
93
- expect(validatePassword()(' ТЕСТТЕСТ ', $t)).toEqual('components.passwordValidation');
94
- expect(validatePassword()(' ТестТест ', $t)).toEqual('components.passwordValidation');
95
- expect(validatePassword()(' ТестТест1 ', $t)).toEqual('components.passwordValidation');
96
- expect(validatePassword()(' ТестТест1@ ', $t)).toEqual(true);
87
+ test('passwordValidation', () => {
88
+ expect(passwordValidation()('', $t)).toEqual('components.passwordValidation');
89
+ expect(passwordValidation()(' ', $t)).toEqual('components.passwordValidation');
90
+ expect(passwordValidation()(null, $t)).toEqual('components.passwordValidation');
91
+ expect(passwordValidation()(undefined, $t)).toEqual('components.passwordValidation');
92
+ expect(passwordValidation()(' тесттест ', $t)).toEqual('components.passwordValidation');
93
+ expect(passwordValidation()(' ТЕСТТЕСТ ', $t)).toEqual('components.passwordValidation');
94
+ expect(passwordValidation()(' ТестТест ', $t)).toEqual('components.passwordValidation');
95
+ expect(passwordValidation()(' ТестТест1 ', $t)).toEqual('components.passwordValidation');
96
+ expect(passwordValidation()(' ТестТест1@ ', $t)).toEqual(true);
97
97
  });
98
98
  });