Add guest to user flow test (#1536)

This commit is contained in:
Luke Vella 2025-01-31 16:54:41 +07:00 committed by GitHub
parent a7b0c62040
commit f7264a885d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 107 additions and 35 deletions

16
apps/web/tests/utils.ts Normal file
View file

@ -0,0 +1,16 @@
import { load } from "cheerio";
import { captureEmailHTML } from "./mailpit/mailpit";
/**
* Get the 6-digit code from the email
* @param email The email address to get the code for
* @returns 6-digit code
*/
export const getCode = async (email: string) => {
const html = await captureEmailHTML(email);
const $ = load(html);
return $("#code").text().trim();
};