Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbb3efafd7 | ||
|
|
626d5ca05c | ||
|
|
68654a8cc0 | ||
|
|
40ce9644ab | ||
|
|
473ea83cdf | ||
|
|
7fb3bd6cf5 | ||
|
|
fb6cbfe9fb | ||
|
|
9c7acf6825 | ||
|
|
102cbfeaad | ||
|
|
377a533466 | ||
|
|
e3f90ca545 | ||
|
|
79b9e448b7 | ||
|
|
aea00d31e8 | ||
|
|
fdaa2e3135 | ||
|
|
67453df51e | ||
|
|
cff5f786a0 | ||
|
|
5debb5bd5e |
@@ -269,4 +269,46 @@ describe("run state flow", () => {
|
||||
|
||||
expect(isCurrentRoomCombatReady(run)).toBe(true);
|
||||
});
|
||||
|
||||
it("lists available traversable exits for the current room", () => {
|
||||
const run = createRunState({
|
||||
content: sampleContentPack,
|
||||
campaignId: "campaign.1",
|
||||
adventurer: createAdventurer(),
|
||||
});
|
||||
|
||||
expect(getAvailableMoves(run)).toEqual([
|
||||
expect.objectContaining({
|
||||
direction: "north",
|
||||
generated: false,
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
it("travels through an unresolved exit, generates a room, and enters it", () => {
|
||||
const run = createRunState({
|
||||
content: sampleContentPack,
|
||||
campaignId: "campaign.1",
|
||||
adventurer: createAdventurer(),
|
||||
at: "2026-03-15T14:00:00.000Z",
|
||||
});
|
||||
|
||||
const result = travelCurrentExit({
|
||||
content: sampleContentPack,
|
||||
run,
|
||||
exitDirection: "north",
|
||||
roller: createSequenceRoller([1, 1]),
|
||||
at: "2026-03-15T14:05:00.000Z",
|
||||
});
|
||||
|
||||
expect(result.run.currentRoomId).toBe("room.level1.room.002");
|
||||
expect(result.run.dungeon.levels["1"]!.discoveredRoomOrder).toEqual([
|
||||
"room.level1.start",
|
||||
"room.level1.room.002",
|
||||
]);
|
||||
expect(result.run.dungeon.levels["1"]!.rooms["room.level1.room.002"]!.discovery.entered).toBe(
|
||||
true,
|
||||
);
|
||||
expect(result.run.log[0]?.text).toContain("Travelled north");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user