You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
819 B
26 lines
819 B
import { describe, expect, test } from "bun:test";
|
|
import {
|
|
assertAdminEmailReady,
|
|
assertCommentEmailConfigReadyForTest,
|
|
CommentEmailTestValidationError,
|
|
} from "./test-mail";
|
|
|
|
describe("comment email test mail validation", () => {
|
|
test("returns 400-equivalent validation error when smtp config is incomplete", () => {
|
|
expect(() =>
|
|
assertCommentEmailConfigReadyForTest({
|
|
enabled: true,
|
|
fromEmail: "",
|
|
smtpHost: "smtp.example.com",
|
|
smtpPort: 465,
|
|
smtpSecure: true,
|
|
smtpUser: "user",
|
|
smtpPass: "pass",
|
|
}),
|
|
).toThrow(CommentEmailTestValidationError);
|
|
});
|
|
|
|
test("returns 400-equivalent validation error when admin email is empty", () => {
|
|
expect(() => assertAdminEmailReady("")).toThrow(CommentEmailTestValidationError);
|
|
});
|
|
});
|
|
|