lint: fix biome issues in new test files and helpers
This commit is contained in:
1 parent
99eb3af17b
commit
93862c2275
41 files changed
+488
-314
No files matched your search
@@ -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",
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user