Skip to content

Commit f8a6e62

Browse files
committed
add jasmine tests
1 parent 5233664 commit f8a6e62

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

test/jasmine/tests/axes_test.js

+47
Original file line numberDiff line numberDiff line change
@@ -5681,6 +5681,53 @@ describe('Test axes', function() {
56815681
});
56825682
});
56835683

5684+
[
5685+
{
5686+
range: ['2019-12-10', '2020-01-10'],
5687+
positions: ['2019-12-16 12:00', '2020-01-10'],
5688+
labels: ['2019-Dec', ' ']
5689+
},
5690+
{
5691+
range: ['2019-12-20', '2020-01-20'],
5692+
positions: ['2019-12-20', '2020-01-16 12:00'],
5693+
labels: [' ', '2020-Jan']
5694+
},
5695+
{
5696+
range: ['2020-01-20', '2019-12-20'],
5697+
positions: ['2020-01-20', '2020-01-16 12:00'],
5698+
labels: [' ', '2020-Jan']
5699+
}
5700+
].forEach(function(t) {
5701+
it('should position labels with monthly tickformat when auto dtick is weekly | range:' + t.range, function(done) {
5702+
Plotly.newPlot(gd, {
5703+
data: [{
5704+
x: [
5705+
'2020-01-01',
5706+
'2020-01-02'
5707+
],
5708+
mode: 'lines+text',
5709+
text: [
5710+
'Jan 01',
5711+
'Jan 02'
5712+
]
5713+
}],
5714+
layout: {
5715+
width: 600,
5716+
xaxis: {
5717+
range: t.range,
5718+
ticklabelmode: 'period',
5719+
tickformat: '%Y-%b'
5720+
}
5721+
}
5722+
})
5723+
.then(function() {
5724+
_assert('', t.positions, t.labels);
5725+
})
5726+
.catch(failTest)
5727+
.then(done);
5728+
});
5729+
});
5730+
56845731
[
56855732
{
56865733
range: ['2020-12-15', '2084-12-15'],

0 commit comments

Comments
 (0)