feat: v0.14.0 — ISS-006 time-scale slider values up to 1000x; tests use fastest time
CI / build + unit + e2e (pull_request) Failing after 4m52s
CI / build + unit + e2e (pull_request) Failing after 4m52s
This commit is contained in:
@@ -31,19 +31,24 @@ describe('POST /api/sim', () => {
|
||||
expect(body.paused).toBe(false);
|
||||
});
|
||||
|
||||
it('sets and clamps timeScale into [1, 64]', async () => {
|
||||
const hi = await post({ timeScale: 500 });
|
||||
it('sets and clamps timeScale into [1, 1000]', async () => {
|
||||
const hi = await post({ timeScale: 2000 });
|
||||
expect(hi.status).toBe(200);
|
||||
expect(((await hi.json()) as { timeScale: number }).timeScale).toBe(64);
|
||||
expect(((await hi.json()) as { timeScale: number }).timeScale).toBe(1000);
|
||||
|
||||
const lo = await post({ timeScale: 0.1 });
|
||||
expect(lo.status).toBe(200);
|
||||
expect(((await lo.json()) as { timeScale: number }).timeScale).toBe(1);
|
||||
|
||||
// The top of the power-of-two ladder passes through unclamped (v0.9.2).
|
||||
const max = await post({ timeScale: 64 });
|
||||
// The top of the ladder passes through unclamped (v0.14.0).
|
||||
const max = await post({ timeScale: 1000 });
|
||||
expect(max.status).toBe(200);
|
||||
expect(((await max.json()) as { timeScale: number }).timeScale).toBe(64);
|
||||
expect(((await max.json()) as { timeScale: number }).timeScale).toBe(1000);
|
||||
|
||||
// In-range values pass through unclamped — ladder and off-ladder alike.
|
||||
const ladder = await post({ timeScale: 500 });
|
||||
expect(ladder.status).toBe(200);
|
||||
expect(((await ladder.json()) as { timeScale: number }).timeScale).toBe(500);
|
||||
|
||||
const mid = await post({ timeScale: 37 });
|
||||
expect(mid.status).toBe(200);
|
||||
|
||||
Reference in New Issue
Block a user