Skip to content

Commit d17c141

Browse files
author
Sergii Kovalenko
committed
Merge remote-tracking branch 'origin/MAGETWO-61425' into BUGS
2 parents 8b202f1 + 306af3e commit d17c141

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

2 files changed

+60
-2
lines changed

app/code/Magento/Ui/view/base/web/js/timeline/timeline.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ define([
104104
* @returns {Boolean}
105105
*/
106106
isActive: function (record) {
107-
return record.status === 1;
107+
return Number(record.status) === 1;
108108
},
109109

110110
/**
@@ -115,7 +115,7 @@ define([
115115
* @returns {Boolean}
116116
*/
117117
isUpcoming: function (record) {
118-
return record.status === 2;
118+
return Number(record.status) === 2;
119119
},
120120

121121
/**
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
});

0 commit comments

Comments
 (0)