mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-23 00:11:28 -07:00
feat(stats): add v1 immersion stats dashboard (#19)
This commit is contained in:
32
src/main/runtime/startup-autoplay-release-policy.test.ts
Normal file
32
src/main/runtime/startup-autoplay-release-policy.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
DEFAULT_AUTOPLAY_RELEASE_RETRY_DELAY_MS,
|
||||
resolveAutoplayReadyMaxReleaseAttempts,
|
||||
STARTUP_AUTOPLAY_RELEASE_TIMEOUT_MS,
|
||||
} from './startup-autoplay-release-policy';
|
||||
|
||||
test('autoplay release keeps the short retry budget for normal playback signals', () => {
|
||||
assert.equal(resolveAutoplayReadyMaxReleaseAttempts(), 3);
|
||||
assert.equal(resolveAutoplayReadyMaxReleaseAttempts({ forceWhilePaused: false }), 3);
|
||||
});
|
||||
|
||||
test('autoplay release uses the full startup timeout window while paused', () => {
|
||||
assert.equal(
|
||||
resolveAutoplayReadyMaxReleaseAttempts({ forceWhilePaused: true }),
|
||||
Math.ceil(
|
||||
STARTUP_AUTOPLAY_RELEASE_TIMEOUT_MS / DEFAULT_AUTOPLAY_RELEASE_RETRY_DELAY_MS,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
test('autoplay release rounds up custom paused retry budgets to cover the timeout window', () => {
|
||||
assert.equal(
|
||||
resolveAutoplayReadyMaxReleaseAttempts({
|
||||
forceWhilePaused: true,
|
||||
retryDelayMs: 300,
|
||||
startupTimeoutMs: 1_000,
|
||||
}),
|
||||
4,
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user