Skip to content

Commit 8cc498e

Browse files
committed
add test for pattern integer hours over night
1 parent ee2d07a commit 8cc498e

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

test/jasmine/tests/axes_test.js

+117
Original file line numberDiff line numberDiff line change
@@ -4222,6 +4222,123 @@ describe('Test axes', function() {
42224222
]);
42234223
});
42244224

4225+
it('should discard coords within break bounds - date hour case of [23, 1]', function() {
4226+
_calc({
4227+
x: [
4228+
'2020-01-01 22',
4229+
'2020-01-01 23',
4230+
'2020-01-01 23:30',
4231+
'2020-01-01 23:59',
4232+
'2020-01-01 23:59:30',
4233+
'2020-01-01 23:59:59',
4234+
'2020-01-02 00:00:00',
4235+
'2020-01-02 00:00:01',
4236+
'2020-01-02 00:00:30',
4237+
'2020-01-02 00:30',
4238+
'2020-01-02 01',
4239+
'2020-01-02 02'
4240+
]
4241+
}, {
4242+
xaxis: {
4243+
rangebreaks: [
4244+
{pattern: 'hour', bounds: [23, 1], operation: '()'}
4245+
]
4246+
}
4247+
});
4248+
_assert('with dflt operation', [
4249+
Lib.dateTime2ms('2020-01-01 22'),
4250+
Lib.dateTime2ms('2020-01-01 23'),
4251+
BADNUM,
4252+
BADNUM,
4253+
BADNUM,
4254+
BADNUM,
4255+
BADNUM,
4256+
BADNUM,
4257+
BADNUM,
4258+
BADNUM,
4259+
Lib.dateTime2ms('2020-01-02 01'),
4260+
Lib.dateTime2ms('2020-01-02 02')
4261+
]);
4262+
});
4263+
4264+
it('should discard coords within break bounds - date hour case of [23, 0]', function() {
4265+
_calc({
4266+
x: [
4267+
'2020-01-01 22',
4268+
'2020-01-01 23',
4269+
'2020-01-01 23:30',
4270+
'2020-01-01 23:59',
4271+
'2020-01-01 23:59:30',
4272+
'2020-01-01 23:59:59',
4273+
'2020-01-02 00:00:00',
4274+
'2020-01-02 00:00:01',
4275+
'2020-01-02 00:00:30',
4276+
'2020-01-02 00:30',
4277+
'2020-01-02 01',
4278+
'2020-01-02 02'
4279+
]
4280+
}, {
4281+
xaxis: {
4282+
rangebreaks: [
4283+
{pattern: 'hour', bounds: [23, 0], operation: '()'}
4284+
]
4285+
}
4286+
});
4287+
_assert('with dflt operation', [
4288+
Lib.dateTime2ms('2020-01-01 22'),
4289+
Lib.dateTime2ms('2020-01-01 23'),
4290+
BADNUM,
4291+
BADNUM,
4292+
BADNUM,
4293+
BADNUM,
4294+
Lib.dateTime2ms('2020-01-02 00:00:00'),
4295+
Lib.dateTime2ms('2020-01-02 00:00:01'),
4296+
Lib.dateTime2ms('2020-01-02 00:00:30'),
4297+
Lib.dateTime2ms('2020-01-02 00:30'),
4298+
Lib.dateTime2ms('2020-01-02 01'),
4299+
Lib.dateTime2ms('2020-01-02 02')
4300+
]);
4301+
});
4302+
4303+
it('should discard coords within break bounds - date hour case of [23, 24]', function() {
4304+
_calc({
4305+
x: [
4306+
'2020-01-01 22',
4307+
'2020-01-01 23',
4308+
'2020-01-01 23:30',
4309+
'2020-01-01 23:59',
4310+
'2020-01-01 23:59:30',
4311+
'2020-01-01 23:59:59',
4312+
'2020-01-02 00:00:00',
4313+
'2020-01-02 00:00:01',
4314+
'2020-01-02 00:00:30',
4315+
'2020-01-02 00:30',
4316+
'2020-01-02 01',
4317+
'2020-01-02 02'
4318+
]
4319+
}, {
4320+
xaxis: {
4321+
rangebreaks: [
4322+
{pattern: 'hour', bounds: [23, 24], operation: '()'}
4323+
]
4324+
}
4325+
});
4326+
_assert('with dflt operation', [
4327+
Lib.dateTime2ms('2020-01-01 22'),
4328+
Lib.dateTime2ms('2020-01-01 23'),
4329+
BADNUM,
4330+
BADNUM,
4331+
BADNUM,
4332+
BADNUM,
4333+
Lib.dateTime2ms('2020-01-02 00:00:00'),
4334+
Lib.dateTime2ms('2020-01-02 00:00:01'),
4335+
Lib.dateTime2ms('2020-01-02 00:00:30'),
4336+
Lib.dateTime2ms('2020-01-02 00:30'),
4337+
Lib.dateTime2ms('2020-01-02 01'),
4338+
Lib.dateTime2ms('2020-01-02 02')
4339+
]);
4340+
});
4341+
42254342
it('should discard coords within [values[i], values[i] + dvalue] bounds', function() {
42264343
var x = [
42274344
// Thursday

0 commit comments

Comments
 (0)