forked from phenom/healer-man
20 lines
953 B
TypeScript
20 lines
953 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { arenaCameraPose } from "./arenaCamera";
|
|
import { ARENA_STAGES } from "./arenaStages";
|
|
|
|
describe("arena camera placement", () => {
|
|
it("uses a finite overview anchor aimed at the playable center of every arena", () => {
|
|
for (const stage of ARENA_STAGES) {
|
|
for (const team of [0, 1] as const) {
|
|
const { position, target } = arenaCameraPose(stage, team);
|
|
expect(position).toEqual(stage.spectatorPositions[team]);
|
|
expect(position[0], `${stage.id} team ${team} x`).toBeGreaterThan(stage.bounds.min[0]);
|
|
expect(position[0], `${stage.id} team ${team} x`).toBeLessThan(stage.bounds.max[0]);
|
|
expect(position[2], `${stage.id} team ${team} z`).toBeGreaterThan(stage.bounds.min[2]);
|
|
expect(position[2], `${stage.id} team ${team} z`).toBeLessThan(stage.bounds.max[2]);
|
|
expect(target.every(Number.isFinite)).toBe(true);
|
|
}
|
|
}
|
|
});
|
|
});
|