File tree Expand file tree Collapse file tree 2 files changed +60
-2
lines changed
app/code/Magento/Ui/view/base/web/js/timeline
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/timeline Expand file tree Collapse file tree 2 files changed +60
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ define([
104
104
* @returns {Boolean }
105
105
*/
106
106
isActive : function ( record ) {
107
- return record . status === 1 ;
107
+ return Number ( record . status ) === 1 ;
108
108
} ,
109
109
110
110
/**
@@ -115,7 +115,7 @@ define([
115
115
* @returns {Boolean }
116
116
*/
117
117
isUpcoming : function ( record ) {
118
- return record . status === 2 ;
118
+ return Number ( record . status ) === 2 ;
119
119
} ,
120
120
121
121
/**
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
+ 'Magento_Ui/js/timeline/timeline'
8
+ ] , function ( Timeline ) {
9
+ 'use strict' ;
10
+
11
+ describe ( 'Magento_Ui/js/timeline/timeline' , function ( ) {
12
+ var timeline ;
13
+
14
+ beforeEach ( function ( ) {
15
+ timeline = new Timeline ( { } ) ;
16
+ } ) ;
17
+
18
+ describe ( 'isActive method' , function ( ) {
19
+ it ( 'record status is 1' , function ( ) {
20
+ expect ( timeline . isActive ( {
21
+ status : 1
22
+ } ) ) . toBe ( true ) ;
23
+ } ) ;
24
+
25
+ it ( 'record status is "1"' , function ( ) {
26
+ expect ( timeline . isActive ( {
27
+ status : '1'
28
+ } ) ) . toBe ( true ) ;
29
+ } ) ;
30
+
31
+ it ( 'record status is 2' , function ( ) {
32
+ expect ( timeline . isActive ( {
33
+ status : 2
34
+ } ) ) . toBe ( false ) ;
35
+ } ) ;
36
+ } ) ;
37
+
38
+ describe ( 'isUpcoming method' , function ( ) {
39
+ it ( 'record status is 2' , function ( ) {
40
+ expect ( timeline . isUpcoming ( {
41
+ status : 2
42
+ } ) ) . toBe ( true ) ;
43
+ } ) ;
44
+
45
+ it ( 'record status is "2"' , function ( ) {
46
+ expect ( timeline . isUpcoming ( {
47
+ status : '2'
48
+ } ) ) . toBe ( true ) ;
49
+ } ) ;
50
+
51
+ it ( 'record status is 1' , function ( ) {
52
+ expect ( timeline . isUpcoming ( {
53
+ status : 1
54
+ } ) ) . toBe ( false ) ;
55
+ } ) ;
56
+ } ) ;
57
+ } ) ;
58
+ } ) ;
You can’t perform that action at this time.
0 commit comments