Deploy deepseek 2
Some checks failed
Test / test (push) Failing after 2s
Build and Deploy Nuxt / build (push) Successful in 1m51s

This commit is contained in:
2026-10-19 19:04:28 +02:00
parent b5d5e570d5
commit 1ec29121e1
45 changed files with 3438 additions and 166 deletions

View File

@@ -368,7 +368,7 @@ test("a carried item brings its own icon", () => {
// --- The traits tab syncs --------------------------------------------------------
test("the world's own traits reach the campaign", () => {
test("the world's own traits and features reach the campaign", () => {
const fromText = foundryActorToCharacter({ name: "Thalia", system: { details: { trait: "Spellcaster.<br>Light sleeper." } } });
assert.equal(fromText.traits, "Spellcaster.\nLight sleeper.");
@@ -376,12 +376,17 @@ test("the world's own traits reach the campaign", () => {
name: "Thalia",
system: {},
items: [
{ name: "Darkvision", type: "feat", system: { featType: "trs", description: { value: "<p>See in the dark.</p>" } } },
{ name: "Brave", type: "feat", system: { featType: ["tr"], description: { value: "Advantage on saves." } } },
{ name: "Alert", type: "feat", system: { featType: "feat", description: { value: "Never surprised." } } },
{ name: "Darkvision", type: "feat", img: "http://vtt.test/icons/eye.svg", system: { type: { value: "race" }, description: { value: "<p>See in the dark.</p>" } } },
{ name: "Second Wind", type: "feat", system: { type: { value: "class" }, description: { value: "Regain hit points." } } },
{ name: "Alert", type: "feat", system: { type: { value: "feat" }, description: { value: "Never surprised." } } },
],
});
assert.equal(fromFeatures.traits, "Darkvision\nSee in the dark.\n\nBrave\nAdvantage on saves.");
assert.deepEqual(fromFeatures.features, [
{ name: "Darkvision", description: "See in the dark.", icon: "http://vtt.test/icons/eye.svg" },
{ name: "Second Wind", description: "Regain hit points.", icon: "" },
{ name: "Alert", description: "Never surprised.", icon: "" },
], "each feature is a row of its own, with the world's icon and text");
assert.ok(!("traits" in fromFeatures), "the feature items are not repeated as free text");
});
test("the world leads the traits tab, and what the campaign wrote fills in when it has none", () => {
@@ -410,6 +415,20 @@ test("an actor that holds no traits does not clear what the campaign has", () =>
assert.ok(!("traits" in character), "a live edit that knows nothing about traits leaves the tab as it is");
});
test("features stand like inventory rows and open their description", () => {
const panel = /<section class="sheet-panel traits-panel">([\s\S]*?)<\/section>/.exec(template)?.[1] ?? "";
assert.match(panel, /v-for="\(trait, index\) in form\.features"/, "one row per feature");
assert.match(panel, /resolveImage\(trait\.icon\)/, "the world's icon sits on the left");
assert.match(panel, /@click="openTrait\(trait\)"/, "clicking a row opens its description");
assert.match(read("frontend", "app", "services", "WindowDefinitions.js"), /trait_sheet: \{/);
assert.deepEqual(
normalizeActor({ features: [{ name: "Darkvision", description: "See in the dark.", icon: "eye.svg" }] }).features,
[{ name: "Darkvision", description: "See in the dark.", icon: "eye.svg" }]
);
assert.deepEqual(normalizeActor({}).features, []);
});
// A forced actor sync from the module's context menu replaces everything the campaign
// holds for that actor (Syndria98/dragonroll#96): the fields a live edit leaves out when
// the world says nothing are written empty instead of kept, and the campaign's own text