Skip to content

Commit 9c64ff7

Browse files
committed
Strengthen supervisor dialog regression coverage
1 parent 1e860b2 commit 9c64ff7

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

packages/web/src/features/supervisor/components/objective-dialog.test.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,44 @@ describe("ObjectiveDialog", () => {
277277
expect(closeButton).toHaveClass("modal-close");
278278
});
279279

280+
it("keeps the canonical dialog header anatomy for enable mode", () => {
281+
const store = createStore();
282+
window.localStorage.setItem("ui.locale", JSON.stringify("en"));
283+
store.set(localeAtom, "en");
284+
store.set(wsClientAtom, { sendCommand: vi.fn() } as never);
285+
store.set(
286+
supervisorDialogAtom,
287+
createDialogState({
288+
mode: "enable",
289+
draftObjective: "Ship phase 4B1",
290+
})
291+
);
292+
store.set(supervisorsAtom, new Map());
293+
294+
render(
295+
<Provider store={store}>
296+
<ObjectiveDialog workspaceId="ws-1" />
297+
</Provider>
298+
);
299+
300+
const dialog = screen.getByRole("dialog");
301+
const header = dialog.querySelector(".dialog-header");
302+
const leading = header?.querySelector(".dialog-header__leading");
303+
const icon = header?.querySelector(".dialog-header__icon");
304+
const copy = header?.querySelector(".dialog-header__copy");
305+
const description = header?.querySelector(".dialog-header__description");
306+
const closeButton = screen.getByRole("button", { name: "Close" });
307+
308+
expect(header).not.toBeNull();
309+
expect(leading).not.toBeNull();
310+
expect(icon).not.toBeNull();
311+
expect(copy).not.toBeNull();
312+
expect(description).toHaveTextContent(
313+
"Describe an objective and Supervisor will evaluate progress and suggest the next step after each turn."
314+
);
315+
expect(closeButton).toHaveClass("modal-close");
316+
});
317+
280318
it("renders footer actions with shared button compatibility classes", () => {
281319
const store = createStore();
282320
window.localStorage.setItem("ui.locale", JSON.stringify("en"));

packages/web/src/features/supervisor/views/shared/objective-dialog-content.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe("ObjectiveDialogContent", () => {
246246
const trigger = screen.getByRole("button", {
247247
name: "supervisor.field.evaluator Codex",
248248
});
249-
expect(trigger).toHaveClass("input", "mobile-select-trigger");
249+
expect(trigger).toHaveClass("input", "mobile-select-trigger", "input-sm");
250250
expect(trigger).toHaveAttribute("aria-haspopup", "dialog");
251251
expect(trigger).toHaveAttribute("aria-describedby");
252252

0 commit comments

Comments
 (0)