Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
21
frontend/tests/antigravityQuotaCountdown.test.ts
Normal file
21
frontend/tests/antigravityQuotaCountdown.test.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { describe, expect, test } from 'vitest';
|
||||
import { getNextAntigravityCountdownUpdateDelay } from '@/features/quota/providers/antigravity/countdown';
|
||||
|
||||
const MINUTE_MS = 60_000;
|
||||
|
||||
describe('Antigravity quota countdown scheduling', () => {
|
||||
test('updates at the next rounded-minute boundary', () => {
|
||||
expect(getNextAntigravityCountdownUpdateDelay([10.5 * MINUTE_MS], 0)).toBe(30_000);
|
||||
expect(getNextAntigravityCountdownUpdateDelay([10 * MINUTE_MS], 0)).toBe(MINUTE_MS);
|
||||
});
|
||||
|
||||
test('uses the earliest boundary across quota buckets', () => {
|
||||
expect(getNextAntigravityCountdownUpdateDelay([10.75 * MINUTE_MS, 3.25 * MINUTE_MS], 0)).toBe(
|
||||
15_000
|
||||
);
|
||||
});
|
||||
|
||||
test('stops scheduling after all reset times expire', () => {
|
||||
expect(getNextAntigravityCountdownUpdateDelay([0, Number.NaN], MINUTE_MS)).toBeNull();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue