Improve distance assertion for runtime target candidates in tests

This commit is contained in:
2026-04-25 16:40:07 +02:00
parent 1f7464bd3a
commit 60d2b3c447

View File

@@ -3662,8 +3662,15 @@ describe("RuntimeHost", () => {
hostInternals.refreshRuntimeTargetingState();
expect(hostInternals.runtimeTargetCandidates[0]?.entityId).toBe(
"npc-close-edge"
const closeCandidate = hostInternals.runtimeTargetCandidates.find(
(candidate) => candidate.entityId === "npc-close-edge"
);
const centeredCandidate = hostInternals.runtimeTargetCandidates.find(
(candidate) => candidate.entityId === "npc-center-farther"
);
expect(closeCandidate?.distance).toBeLessThan(
centeredCandidate?.distance ?? 0
);
expect(hostInternals.proposedRuntimeTarget).toMatchObject({
kind: "npc",