27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
AETHER_ARMORED_SHIP_COLORS,
|
|
AETHER_STANDARD_SHIP_COLORS,
|
|
aetherShipColor,
|
|
aetherShipColorIndex,
|
|
} from "./aetherAssaultVisuals";
|
|
|
|
describe("Aether Assault ship colors", () => {
|
|
it("assigns a deterministic mixed palette across a formation", () => {
|
|
const first = Array.from({ length: 6 }, (_, index) => aetherShipColor(1234, 1, index, "standard"));
|
|
const replay = Array.from({ length: 6 }, (_, index) => aetherShipColor(1234, 1, index, "standard"));
|
|
|
|
expect(replay).toEqual(first);
|
|
expect(new Set(first).size).toBe(AETHER_STANDARD_SHIP_COLORS.length);
|
|
});
|
|
|
|
it("changes palette ordering between waves and keeps armored variants distinct", () => {
|
|
const waveOneIndex = aetherShipColorIndex(42, 1, 0);
|
|
const waveTwoIndex = aetherShipColorIndex(42, 2, 0);
|
|
|
|
expect(waveTwoIndex).not.toBe(waveOneIndex);
|
|
expect(aetherShipColor(42, 1, 0, "standard")).toBe(AETHER_STANDARD_SHIP_COLORS[waveOneIndex]);
|
|
expect(aetherShipColor(42, 1, 0, "armored")).toBe(AETHER_ARMORED_SHIP_COLORS[waveOneIndex]);
|
|
});
|
|
});
|