Update CSP to allow external fonts, scripts, and add corresponding test coverage
CI / check (22) (push) Failing after 15m50s
CI / check (24) (push) Failing after 15m50s

This commit is contained in:
2026-10-08 00:11:22 +02:00
parent 2275ddfb90
commit 0f58a996ec
2 changed files with 47 additions and 9 deletions
+5 -3
View File
@@ -16,10 +16,12 @@ test("personality metadata is curated and never exposes system prompts", () => {
assert.ok(item.name && item.specialization && item.description && item.longDescription);
assert.ok(item.historicalInspiration && item.icon && item.accentColor);
assert.equal("systemPrompt" in item, false);
const prompt = getPersonality(item.id).systemPrompt;
assert.ok(prompt.length >= 1200, `${item.name} should have a substantial task-specific prompt`);
}
assert.match(getPersonality("creative-writer").systemPrompt, /narrative cohesion/);
assert.match(getPersonality("creative-writer").systemPrompt, /do not default to archaic language/);
assert.match(getPersonality("tutor").systemPrompt, /do not turn every exchange into a quiz or answer only with questions/);
assert.match(getPersonality("creative-writer").systemPrompt, /Do not default to archaic language/);
assert.match(getPersonality("tutor").systemPrompt, /Do not turn every exchange into a quiz or answer only with questions/);
assert.match(getPersonality("programmer").systemPrompt, /smallest complete change/);
});
@@ -46,7 +48,7 @@ test("chat prompt uses its stored personality and persists personality selection
}
});
await ollama.generateReply("configured:model", payload.messagesPayload);
assert.match(sent.messages.find(item => item.role === "system" && item.content.includes("specialized creative-writing partner")).content, /Follow the user's genre/);
assert.match(sent.messages.find(item => item.role === "system" && item.content.includes("specialized creative-writing partner")).content, /Honor the user's genre/);
assert.equal(sent.messages.at(-1).content, "Continue");
});