test: merge chat context notice checks

This commit is contained in:
Peter Steinberger
2026-04-17 18:36:33 +01:00
parent 1df50183b2
commit 5c2f4afcce

View File

@@ -93,9 +93,11 @@ async function renderContextNoticeChat() {
describe("chat context notice", () => {
afterEach(() => {
document.body.innerHTML = "";
document.documentElement.style.removeProperty("--warn");
document.documentElement.style.removeProperty("--danger");
});
it("falls back to default notice colors when theme vars are not hex", async () => {
it("renders robust notice colors and badge-sized warning icon", async () => {
document.documentElement.style.setProperty("--warn", "rgb(1, 2, 3)");
document.documentElement.style.setProperty("--danger", "tomato");
const container = await renderContextNoticeChat();
@@ -106,13 +108,6 @@ describe("chat context notice", () => {
expect(notice?.style.getPropertyValue("--ctx-color")).not.toContain("NaN");
expect(notice?.style.getPropertyValue("--ctx-bg")).not.toContain("NaN");
document.documentElement.style.removeProperty("--warn");
document.documentElement.style.removeProperty("--danger");
});
it("keeps the warning icon badge-sized", async () => {
const container = await renderContextNoticeChat();
const icon = container.querySelector<SVGElement>(".context-notice__icon");
expect(icon).not.toBeNull();
if (!icon) {