Merge branch 'feature/potion-descriptions'
@@ -1,7 +1,7 @@
1
1
import test from "node:test";
2
2
import assert from "node:assert/strict";
3
3
import { BlockType } from "../../shared/definitions/tiles.js";
4
import { ItemId, itemDefinition } from "../../shared/definitions/items.js";
4
import { ItemId, itemDefinition, itemDescription } from "../../shared/definitions/items.js";
5
5
import { flowerItemInstance } from "../../shared/definitions/dyes.js";
6
6
import { AlchemyStepKind } from "../../shared/definitions/alchemy.js";
7
7
import
@@ -68,6 +68,31 @@ test("recipe paper body resolves ingredient keys to display names", () =>
68
68
);
69
69
});
70
70
71
test("potion item descriptions come from alchemy defs without repeating the name", () =>
72
{
73
const stack = {
74
itemId: ItemId.potion,
75
quantity: 1,
76
instance: {
77
kind: "potion",
78
potionKey: "lesserHealthTonic",
79
displayName: "Lesser health tonic",
80
unstable: false
81
}
82
};
83
const desc = itemDescription(stack);
84
assert.equal(desc, alchemyPotionDefinition("lesserHealthTonic").description);
85
assert.doesNotMatch(desc, /Lesser health tonic/i);
86
assert.equal(
87
itemDescription({
88
itemId: ItemId.potion,
89
quantity: 1,
90
instance: { kind: "potion", potionKey: "x", displayName: "Bad", unstable: true }
91
}),
92
"The brew smells wrong — best sipped with caution."
93
);
94
});
95
71
96
test("lesser health tonic ratios and steps evaluate to a success batch", () =>
72
97
{
73
98
const potion = resolvedAlchemyPotions().find((entry) => entry.potionKey === "lesserHealthTonic");
@@ -1,7 +1,7 @@1
import test from "node:test";1
import test from "node:test";2
import assert from "node:assert/strict";2
import assert from "node:assert/strict";3
import { BlockType } from "../../shared/definitions/tiles.js";3
import { BlockType } from "../../shared/definitions/tiles.js";4
import { ItemId, itemDefinition } from "../../shared/definitions/items.js";4
import { ItemId, itemDefinition, itemDescription } from "../../shared/definitions/items.js";5
import { flowerItemInstance } from "../../shared/definitions/dyes.js";5
import { flowerItemInstance } from "../../shared/definitions/dyes.js";6
import { AlchemyStepKind } from "../../shared/definitions/alchemy.js";6
import { AlchemyStepKind } from "../../shared/definitions/alchemy.js";7
import7
import@@ -68,6 +68,31 @@ test("recipe paper body resolves ingredient keys to display names", () =>68
);68
);69
});69
});70
70
71
test("potion item descriptions come from alchemy defs without repeating the name", () =>72
{73
const stack = {74
itemId: ItemId.potion,75
quantity: 1,76
instance: {77
kind: "potion",78
potionKey: "lesserHealthTonic",79
displayName: "Lesser health tonic",80
unstable: false81
}82
};83
const desc = itemDescription(stack);84
assert.equal(desc, alchemyPotionDefinition("lesserHealthTonic").description);85
assert.doesNotMatch(desc, /Lesser health tonic/i);86
assert.equal(87
itemDescription({88
itemId: ItemId.potion,89
quantity: 1,90
instance: { kind: "potion", potionKey: "x", displayName: "Bad", unstable: true }91
}),92
"The brew smells wrong — best sipped with caution."93
);94
});95
71
test("lesser health tonic ratios and steps evaluate to a success batch", () =>96
test("lesser health tonic ratios and steps evaluate to a success batch", () =>72
{97
{73
const potion = resolvedAlchemyPotions().find((entry) => entry.potionKey === "lesserHealthTonic");98
const potion = resolvedAlchemyPotions().find((entry) => entry.potionKey === "lesserHealthTonic");