This commit is contained in:
syuilo 2020-03-07 01:10:13 +09:00
parent 1947835c51
commit 8946f3ea18

View file

@ -309,6 +309,35 @@ describe('Chart', () => {
}); });
})); }));
it('Can specify offset (floor time)', async(async () => {
clock.tick('00:30:00');
await testChart.increment();
clock.tick('01:30:00');
await testChart.increment();
const chartHours = await testChart.getChart('hour', 3, 1);
const chartDays = await testChart.getChart('day', 3, 1);
assert.deepStrictEqual(chartHours, {
foo: {
dec: [0, 0, 0],
inc: [1, 0, 0],
total: [1, 0, 0]
},
});
assert.deepStrictEqual(chartDays, {
foo: {
dec: [0, 0, 0],
inc: [0, 0, 0],
total: [0, 0, 0]
},
});
}));
describe('Grouped', () => { describe('Grouped', () => {
it('Can updates', async(async () => { it('Can updates', async(async () => {
await testGroupedChart.increment('alice'); await testGroupedChart.increment('alice');