refactor: move mailer test (#4328)

This commit is contained in:
Alex Yang
2023-09-12 22:11:19 -07:00
committed by GitHub
parent bdc2695caf
commit 74faee887e
8 changed files with 29 additions and 42 deletions

View File

@@ -12,6 +12,18 @@ import { hash } from '@node-rs/argon2';
import type { BrowserContext, Cookie, Page } from '@playwright/test';
import { z } from 'zod';
export async function getCurrentMailMessageCount() {
const response = await fetch('http://localhost:8025/api/v2/messages');
const data = await response.json();
return data.total;
}
export async function getLatestMailMessage() {
const response = await fetch('http://localhost:8025/api/v2/messages');
const data = await response.json();
return data.items[0];
}
export async function getLoginCookie(
context: BrowserContext
): Promise<Cookie | undefined> {