-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⏫ Forwardport of #12739 to 2.3-develop branch
Applied pull request patch https://github.com/magento/magento2/pull/12739.patch (created by @zamoroka) based on commit(s): 1. 465e14b 2. 8bc807f 3. e9dcb03 Fixed GitHub Issues in 2.3-develop branch: - #6113: Validate range-words in Form component (UI Component) (reported by @robinhuy)
- 2.4.8-beta2
- 2.4.8-beta1
- 2.4.7
- 2.4.7-p4
- 2.4.7-p3
- 2.4.7-p2
- 2.4.7-p1
- 2.4.7-beta3
- 2.4.7-beta2
- 2.4.7-beta1
- 2.4.6
- 2.4.6-p9
- 2.4.6-p8
- 2.4.6-p7
- 2.4.6-p6
- 2.4.6-p5
- 2.4.6-p4
- 2.4.6-p3
- 2.4.6-p2
- 2.4.6-p1
- 2.4.5
- 2.4.5-p11
- 2.4.5-p10
- 2.4.5-p9
- 2.4.5-p8
- 2.4.5-p7
- 2.4.5-p6
- 2.4.5-p5
- 2.4.5-p4
- 2.4.5-p3
- 2.4.5-p2
- 2.4.5-p1
- 2.4.4
- 2.4.4-p12
- 2.4.4-p11
- 2.4.4-p10
- 2.4.4-p9
- 2.4.4-p8
- 2.4.4-p7
- 2.4.4-p6
- 2.4.4-p5
- 2.4.4-p4
- 2.4.4-p3
- 2.4.4-p2
- 2.4.4-p1
- 2.4.3
- 2.4.3-p3
- 2.4.3-p2
- 2.4.3-p1
- 2.4.2
- 2.4.2-p2
- 2.4.2-p1
- 2.4.1
- 2.4.1-p1
- 2.4.0
- 2.4.0-p1
- 2.3.7
- 2.3.7-p4
- 2.3.7-p3
- 2.3.7-p2
- 2.3.7-p1
- 2.3.6
- 2.3.6-p1
- 2.3.5
- 2.3.5-p2
- 2.3.5-p1
- 2.3.4
- 2.3.4-p2
- 2.3.3
- 2.3.3-p1
- 2.3.2
- 2.3.2-p2
- 2.3.1
- 2.3.0
1 parent
8e77e2f
commit 934818d
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/validation/rules.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
/* eslint-disable max-nested-callbacks */ | ||
define([ | ||
'Magento_Ui/js/lib/validation/rules' | ||
], function (rules) { | ||
'use strict'; | ||
|
||
describe('Magento_Ui/js/lib/validation/rules', function () { | ||
describe('"range-words" method', function () { | ||
it('Check on empty value', function () { | ||
var value = '', | ||
params = [1,3]; | ||
|
||
expect(rules['range-words'].handler(value, params)).toBe(false); | ||
}); | ||
|
||
it('Check on redundant words', function () { | ||
var value = 'a b c d', | ||
params = [1,3]; | ||
|
||
expect(rules['range-words'].handler(value, params)).toBe(false); | ||
}); | ||
|
||
it('Check with three words', function () { | ||
var value = 'a b c', | ||
params = [1,3]; | ||
|
||
expect(rules['range-words'].handler(value, params)).toBe(true); | ||
}); | ||
|
||
it('Check with one word', function () { | ||
var value = 'a', | ||
params = [1,3]; | ||
|
||
expect(rules['range-words'].handler(value, params)).toBe(true); | ||
}); | ||
}); | ||
}); | ||
}); |