Improve distance assertion for runtime target candidates in tests
This commit is contained in:
@@ -3662,8 +3662,15 @@ describe("RuntimeHost", () => {
|
|||||||
|
|
||||||
hostInternals.refreshRuntimeTargetingState();
|
hostInternals.refreshRuntimeTargetingState();
|
||||||
|
|
||||||
expect(hostInternals.runtimeTargetCandidates[0]?.entityId).toBe(
|
const closeCandidate = hostInternals.runtimeTargetCandidates.find(
|
||||||
"npc-close-edge"
|
(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({
|
expect(hostInternals.proposedRuntimeTarget).toMatchObject({
|
||||||
kind: "npc",
|
kind: "npc",
|
||||||
|
|||||||
Reference in New Issue
Block a user