Add more typescript types (#867)

This commit is contained in:
Anton Podviaznikov authored and GitHub committed 2021-10-07 09:47:33 +01:00
1 parent effbd44f48
commit c62e1a0eeb
3 files changed
+51 -18

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { expect, it } from "@jest/globals";
import { html, text, Invitation } from "@lib/emails/invitation";
it("email text rendering should strip tags and add new lines", () => {
const result = text("<p>hello world</p><br /><div>welcome to the brave <span>new</span> world");
expect(result).toEqual("hello world\nwelcome to the brave new world");
});
it("email html should render invite email", () => {
const invitation = {
from: "Huxley",
toEmail: "[email protected]",
teamName: "Calendar Lovers",
token: "invite-token",
} as Invitation;
const result = html(invitation);
expect(result).toContain('<br />Huxley invited you to join the team "Calendar Lovers" in Cal.com.<br />');
expect(result).toContain("/auth/signup?token=invite-token&");
expect(result).toContain(
'If you prefer not to use "[email protected]" as your Cal.com email or already have a Cal.com account, please request another invitation to that email.'
);
});