lint: fix biome issues in new test files and helpers
CI / check (push) Failing after 34s
CI / preflight (push) Skipped
CI / deploy (push) Skipped

This commit is contained in:
openhands committed 2026-09-21 18:19:39 +02:00
1 parent 99eb3af17b
commit 93862c2275
41 files changed
+488 -314

No files matched your search

+13 -11
View File
@@ -93,21 +93,23 @@ describe("postShout", () => {
});
it("rejects an empty or whitespace-only message as invalid", async () => {
await expect(
postShout(buildForm({ message: "" })),
).rejects.toThrow("/radio/shouts?error=invalid");
await expect(
postShout(buildForm({ message: " " })),
).rejects.toThrow("/radio/shouts?error=invalid");
await expect(
postShout(buildForm({ message: undefined })),
).rejects.toThrow("/radio/shouts?error=invalid");
await expect(postShout(buildForm({ message: "" }))).rejects.toThrow(
"/radio/shouts?error=invalid",
);
await expect(postShout(buildForm({ message: " " }))).rejects.toThrow(
"/radio/shouts?error=invalid",
);
await expect(postShout(buildForm({ message: undefined }))).rejects.toThrow(
"/radio/shouts?error=invalid",
);
expect(state.insert).not.toHaveBeenCalled();
expect(state.revalidatePath).toHaveBeenCalledWith("/radio/shouts");
});
it("redirects with error=moderated when content moderation rejects the message", async () => {
state.moderateOrThrow.mockRejectedValue(new Error("Blocked by word filter"));
state.moderateOrThrow.mockRejectedValue(
new Error("Blocked by word filter"),
);
await expect(postShout(buildForm())).rejects.toThrow(
"/radio/shouts?error=moderated",
);
@@ -141,4 +143,4 @@ describe("postShout", () => {
"/radio/shouts?error=error",
);
});
});
});