From 7f744410bfdde81de57a911d2fe3f82c40fc5198 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Wed, 6 May 2026 23:23:13 +0300 Subject: [PATCH] wire mailpit and db:promote cypress tasks --- frontend/blog_portal/cypress.config.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/blog_portal/cypress.config.ts b/frontend/blog_portal/cypress.config.ts index 9f9987c..5f5c1df 100644 --- a/frontend/blog_portal/cypress.config.ts +++ b/frontend/blog_portal/cypress.config.ts @@ -3,6 +3,7 @@ import { execSync } from "node:child_process"; import { resolve } from "node:path"; const backendDir = resolve(__dirname, "../../backend"); +const mailpitBase = "http://localhost:8025/api/v1"; export default defineConfig({ e2e: { @@ -23,6 +24,25 @@ export default defineConfig({ }); return null; }, + "db:promote": function (email: string) { + execSync(`php artisan user:promote ${JSON.stringify(email)}`, { + cwd: backendDir, + stdio: "pipe", + }); + return null; + }, + "mailpit:clear": async function () { + await fetch(`${mailpitBase}/messages`, { method: "DELETE" }); + return null; + }, + "mailpit:messages": async function () { + const response = await fetch(`${mailpitBase}/messages`); + return response.json(); + }, + "mailpit:message": async function (id: string) { + const response = await fetch(`${mailpitBase}/message/${id}`); + return response.json(); + }, }); }, },