test(FN-5046): complete Step 5 — cover terminal-only settings modal behavior
Fusion-Task-Id: FN-5046 Fusion-Task-Lineage: 0748fd0e-70c3-44b9-a599-0df5255d4d60
This commit is contained in:
committed by
gsxdsm
parent
000b0e6c93
commit
d955c7d279
@@ -4076,6 +4076,40 @@ describe("SettingsModal", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps delay enabled when failure mode is terminal-only", async () => {
|
||||
mockFetchSettings.mockResolvedValueOnce({
|
||||
...defaultSettings,
|
||||
failureNotificationMode: "terminal-only",
|
||||
});
|
||||
renderModal();
|
||||
await waitForSettingsModalReady();
|
||||
await openNotificationsSection();
|
||||
|
||||
const modeSelect = screen.getByLabelText("Failure notification mode") as HTMLSelectElement;
|
||||
const delayInput = screen.getByLabelText("Failure notification delay (ms)") as HTMLInputElement;
|
||||
|
||||
expect(modeSelect.value).toBe("terminal-only");
|
||||
expect(delayInput).not.toBeDisabled();
|
||||
});
|
||||
|
||||
it("persists terminal-only selection on save", async () => {
|
||||
renderModal();
|
||||
await waitForSettingsModalReady();
|
||||
await openNotificationsSection();
|
||||
|
||||
const modeSelect = screen.getByLabelText("Failure notification mode") as HTMLSelectElement;
|
||||
await userEvent.selectOptions(modeSelect, "terminal-only");
|
||||
await userEvent.click(screen.getByRole("button", { name: "Save" }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockUpdateGlobalSettings).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
failureNotificationMode: "terminal-only",
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
provider: "ntfy",
|
||||
|
||||
Reference in New Issue
Block a user