File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Payment/base/js/model/credit-card-validation Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © 2013-2017 Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ define ( [
7
+ 'jquery' ,
8
+ 'jquery/validate' ,
9
+ 'Magento_Payment/js/model/credit-card-validation/validator'
10
+ ] , function ( $ ) {
11
+ 'use strict' ;
12
+
13
+ describe ( 'Magento_Payment/js/model/credit-card-validation/validator' , function ( ) {
14
+
15
+ it ( 'Check credit card expiration year validator.' , function ( ) {
16
+ var year = new Date ( ) . getFullYear ( ) ;
17
+
18
+ expect ( $ . validator . methods [ 'validate-card-year' ] ( '1234' ) ) . toBeFalsy ( ) ;
19
+ expect ( $ . validator . methods [ 'validate-card-year' ] ( '' ) ) . toBeFalsy ( ) ;
20
+ expect ( $ . validator . methods [ 'validate-card-year' ] ( ( year - 1 ) . toString ( ) ) ) . toBeFalsy ( ) ;
21
+ expect ( $ . validator . methods [ 'validate-card-year' ] ( ( year + 1 ) . toString ( ) ) ) . toBeTruthy ( ) ;
22
+ } ) ;
23
+ } ) ;
24
+ } ) ;
You can’t perform that action at this time.
0 commit comments