Skip to content

Commit f0f078a

Browse files
committed
convert milliseconds to date strings in tests
1 parent 9399031 commit f0f078a

File tree

1 file changed

+67
-66
lines changed

1 file changed

+67
-66
lines changed

test/jasmine/tests/axes_test.js

+67-66
Original file line numberDiff line numberDiff line change
@@ -5207,7 +5207,8 @@ describe('Test axes', function() {
52075207
afterEach(destroyGraphDiv);
52085208

52095209
function _assert(msg, exp) {
5210-
var labelPositions = gd._fullLayout.xaxis._vals.map(function(d) { return d.periodX; });
5210+
var ax = gd._fullLayout.xaxis;
5211+
var labelPositions = ax._vals.map(function(d) { return ax.c2d(d.periodX); });
52115212
expect(labelPositions).withContext(msg).toEqual(exp);
52125213
}
52135214

@@ -5227,14 +5228,14 @@ describe('Test axes', function() {
52275228
})
52285229
.then(function() {
52295230
_assert('', [
5230-
1562079600000,
5231-
1593615600000,
5232-
1625238000000,
5233-
1656774000000,
5234-
1688310000000,
5235-
1719846000000,
5236-
1751468400000,
5237-
1783004400000
5231+
'2019-07-02 15:00',
5232+
'2020-07-01 15:00',
5233+
'2021-07-02 15:00',
5234+
'2022-07-02 15:00',
5235+
'2023-07-02 15:00',
5236+
'2024-07-01 15:00',
5237+
'2025-07-02 15:00',
5238+
'2026-07-02 15:00'
52385239
]);
52395240
})
52405241
.catch(failTest)
@@ -5257,16 +5258,16 @@ describe('Test axes', function() {
52575258
})
52585259
.then(function() {
52595260
_assert('', [
5260-
1573832700000,
5261-
1581781500000,
5262-
1589643900000,
5263-
1597506300000,
5264-
1605455100000,
5265-
1613403900000,
5266-
1621179900000,
5267-
1629042300000,
5268-
1636991100000,
5269-
1644939900000
5261+
'2019-11-15 15:45',
5262+
'2020-02-15 15:45',
5263+
'2020-05-16 15:45',
5264+
'2020-08-15 15:45',
5265+
'2020-11-15 15:45',
5266+
'2021-02-15 15:45',
5267+
'2021-05-16 15:45',
5268+
'2021-08-15 15:45',
5269+
'2021-11-15 15:45',
5270+
'2022-02-15 15:45'
52705271
]);
52715272
})
52725273
.catch(failTest)
@@ -5289,14 +5290,14 @@ describe('Test axes', function() {
52895290
})
52905291
.then(function() {
52915292
_assert('', [
5292-
1576473300000,
5293-
1579151700000,
5294-
1581830100000,
5295-
1584335700000,
5296-
1587014100000,
5297-
1589606100000,
5298-
1592284500000,
5299-
1594876500000
5293+
'2019-12-16 05:15',
5294+
'2020-01-16 05:15',
5295+
'2020-02-16 05:15',
5296+
'2020-03-16 05:15',
5297+
'2020-04-16 05:15',
5298+
'2020-05-16 05:15',
5299+
'2020-06-16 05:15',
5300+
'2020-07-16 05:15'
53005301
]);
53015302
})
53025303
.catch(failTest)
@@ -5319,16 +5320,16 @@ describe('Test axes', function() {
53195320
})
53205321
.then(function() {
53215322
_assert('', [
5322-
1580299200000,
5323-
1580904000000,
5324-
1581508800000,
5325-
1582113600000,
5326-
1582718400000,
5327-
1583323200000,
5328-
1583928000000,
5329-
1584532800000,
5330-
1585137600000,
5331-
1585742400000
5323+
'2020-01-29 12:00',
5324+
'2020-02-05 12:00',
5325+
'2020-02-12 12:00',
5326+
'2020-02-19 12:00',
5327+
'2020-02-26 12:00',
5328+
'2020-03-04 12:00',
5329+
'2020-03-11 12:00',
5330+
'2020-03-18 12:00',
5331+
'2020-03-25 12:00',
5332+
'2020-04-01 12:00'
53325333
]);
53335334
})
53345335
.catch(failTest)
@@ -5351,16 +5352,16 @@ describe('Test axes', function() {
53515352
})
53525353
.then(function() {
53535354
_assert('', [
5354-
1580385600000,
5355-
1580990400000,
5356-
1581595200000,
5357-
1582200000000,
5358-
1582804800000,
5359-
1583409600000,
5360-
1584014400000,
5361-
1584619200000,
5362-
1585224000000,
5363-
1585828800000
5355+
'2020-01-30 12:00',
5356+
'2020-02-06 12:00',
5357+
'2020-02-13 12:00',
5358+
'2020-02-20 12:00',
5359+
'2020-02-27 12:00',
5360+
'2020-03-05 12:00',
5361+
'2020-03-12 12:00',
5362+
'2020-03-19 12:00',
5363+
'2020-03-26 12:00',
5364+
'2020-04-02 12:00'
53645365
]);
53655366
})
53665367
.catch(failTest)
@@ -5384,15 +5385,15 @@ describe('Test axes', function() {
53845385
})
53855386
.then(function() {
53865387
_assert('', [
5387-
1577793600000,
5388-
1577880000000,
5389-
1577966400000,
5390-
1578052800000,
5391-
1578139200000,
5392-
1578225600000,
5393-
1578312000000,
5394-
1578398400000,
5395-
1578484800000
5388+
'2019-12-31 12:00',
5389+
'2020-01-01 12:00',
5390+
'2020-01-02 12:00',
5391+
'2020-01-03 12:00',
5392+
'2020-01-04 12:00',
5393+
'2020-01-05 12:00',
5394+
'2020-01-06 12:00',
5395+
'2020-01-07 12:00',
5396+
'2020-01-08 12:00'
53965397
]);
53975398
})
53985399
.catch(failTest)
@@ -5416,16 +5417,16 @@ describe('Test axes', function() {
54165417
})
54175418
.then(function() {
54185419
_assert('', [
5419-
1577826000000,
5420-
1577836800000,
5421-
1577847600000,
5422-
1577858400000,
5423-
1577869200000,
5424-
1577880000000,
5425-
1577890800000,
5426-
1577901600000,
5427-
1577912400000,
5428-
1577923200000
5420+
'2019-12-31 21:00',
5421+
'2020-01-01',
5422+
'2020-01-01 03:00',
5423+
'2020-01-01 06:00',
5424+
'2020-01-01 09:00',
5425+
'2020-01-01 12:00',
5426+
'2020-01-01 15:00',
5427+
'2020-01-01 18:00',
5428+
'2020-01-01 21:00',
5429+
'2020-01-02'
54295430
]);
54305431
})
54315432
.catch(failTest)

0 commit comments

Comments
 (0)