Skip to content

Commit 25c50ec

Browse files
committed
MAGETWO-61425: Fix timeline status detection
1 parent 54b05b1 commit 25c50ec

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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({status: 1})).toBe(true);
21+
});
22+
23+
it('record status is "1"', function () {
24+
expect(timeline.isActive({status: '1'})).toBe(true);
25+
});
26+
27+
it('record status is 2', function () {
28+
expect(timeline.isActive({status: 2})).toBe(false);
29+
});
30+
});
31+
32+
describe('isUpcoming method', function () {
33+
it('record status is 2', function () {
34+
expect(timeline.isUpcoming({status: 2})).toBe(true);
35+
});
36+
37+
it('record status is "2"', function () {
38+
expect(timeline.isUpcoming({status: '2'})).toBe(true);
39+
});
40+
41+
it('record status is 1', function () {
42+
expect(timeline.isUpcoming({status: 1})).toBe(false);
43+
});
44+
});
45+
});
46+
});

0 commit comments

Comments
 (0)