mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-16 16:05:33 +02:00
📦️ Update smtp-tester and fix test environment config (#1181)
This commit is contained in:
parent
0a0c38f1d4
commit
f66653c21a
8 changed files with 45 additions and 128 deletions
|
@ -4,7 +4,7 @@ import { load } from "cheerio";
|
|||
import smtpTester from "smtp-tester";
|
||||
|
||||
const testUserEmail = "test@example.com";
|
||||
let mailServer: smtpTester.SmtpTester;
|
||||
let mailServer: smtpTester.MailServer;
|
||||
/**
|
||||
* Get the 6-digit code from the email
|
||||
* @returns 6-digit code
|
||||
|
@ -14,6 +14,10 @@ const getCode = async () => {
|
|||
wait: 5000,
|
||||
});
|
||||
|
||||
if (!email.html) {
|
||||
throw new Error("Email doesn't contain HTML");
|
||||
}
|
||||
|
||||
const $ = load(email.html);
|
||||
|
||||
return $("#code").text().trim();
|
||||
|
@ -34,7 +38,8 @@ test.describe.serial(() => {
|
|||
} catch {
|
||||
// User doesn't exist
|
||||
}
|
||||
mailServer.stop();
|
||||
|
||||
mailServer.stop(() => {});
|
||||
});
|
||||
|
||||
test.describe("new user", () => {
|
||||
|
@ -109,6 +114,10 @@ test.describe.serial(() => {
|
|||
wait: 5000,
|
||||
});
|
||||
|
||||
if (!email.html) {
|
||||
throw new Error("Email doesn't contain HTML");
|
||||
}
|
||||
|
||||
const $ = load(email.html);
|
||||
|
||||
const magicLink = $("#magicLink").attr("href");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue