mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
test fix
This commit is contained in:
parent
3cecc6779f
commit
1514cbd984
1 changed files with 4 additions and 4 deletions
|
@ -612,14 +612,14 @@ test("Test getAggregatedBuckets - 31-63 day edge case (daily data)", async (t) =
|
||||||
// Reset to current time
|
// Reset to current time
|
||||||
UptimeCalculator.currentDate = currentTime;
|
UptimeCalculator.currentDate = currentTime;
|
||||||
|
|
||||||
// Test 35-day range (should use daily data, not hourly)
|
// Test 35-day range with buckets that match data granularity (no scale factor)
|
||||||
let buckets = c.getAggregatedBuckets(35, 70); // 35 days with 70 buckets
|
let buckets = c.getAggregatedBuckets(35, 35); // 35 days with 35 buckets = 1 day per bucket
|
||||||
|
|
||||||
assert.strictEqual(buckets.length, 70);
|
assert.strictEqual(buckets.length, 35);
|
||||||
|
|
||||||
// Count non-empty buckets - should have data distributed across buckets
|
// Count non-empty buckets - should have data distributed across buckets
|
||||||
let nonEmptyBuckets = buckets.filter(b => b.up > 0 || b.down > 0).length;
|
let nonEmptyBuckets = buckets.filter(b => b.up > 0 || b.down > 0).length;
|
||||||
assert.ok(nonEmptyBuckets > 20, `Expected more than 20 non-empty buckets, got ${nonEmptyBuckets}`);
|
assert.ok(nonEmptyBuckets > 30, `Expected more than 30 non-empty buckets, got ${nonEmptyBuckets}`);
|
||||||
|
|
||||||
// Verify buckets cover the full time range without gaps
|
// Verify buckets cover the full time range without gaps
|
||||||
for (let i = 0; i < buckets.length - 1; i++) {
|
for (let i = 0; i < buckets.length - 1; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue