Skip to content

Commit 60401c6

Browse files
authored
test(gui): cover Log Guard inspection failures
1 parent 44d2561 commit 60401c6

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎gui/tests/storage-log-guard.test.tsx‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,35 @@ test("Storage overview localizes external and inspect-only labels", () => {
9191
expect(html).not.toContain("external sqlite_home");
9292
expect(html).not.toContain("/state/codex");
9393
});
94+
95+
test("Storage overview renders a fixed localized inspection-failure state", () => {
96+
const value = report();
97+
value.codexLogs = null;
98+
value.codexLogsError = "inspect_failed";
99+
100+
const html = renderToStaticMarkup(
101+
<I18nContext.Provider value={{ locale: "de", setLocale: () => {}, t: germanT() }}>
102+
<StorageWorkspace report={value} locale="de" />
103+
</I18nContext.Provider>,
104+
);
105+
106+
expect(html).toContain('data-testid="codex-log-guard-unavailable"');
107+
expect(html).toContain("Die Diagnoseprotokoll-Inspektion ist nicht verfügbar.");
108+
expect(html).not.toContain("inspect_failed");
109+
});
110+
111+
test("Storage overview does not render arbitrary Log Guard error strings", () => {
112+
const value = report();
113+
value.codexLogs = null;
114+
value.codexLogsError = "/private/state/logs_2.sqlite failed";
115+
116+
const html = renderToStaticMarkup(
117+
<LanguageProvider>
118+
<StorageWorkspace report={value} locale="en" />
119+
</LanguageProvider>,
120+
);
121+
122+
expect(html).not.toContain('data-testid="codex-log-guard-unavailable"');
123+
expect(html).not.toContain("/private/state/logs_2.sqlite");
124+
expect(html).not.toContain("failed");
125+
});

0 commit comments

Comments
 (0)