import { test, expect } from "@playwright/test"; import * as fs from "fs"; import * as path from "path"; const REPO_ROOT = path.resolve(__dirname, "../.."); const NOTIFY_SCRIPT = path.join( REPO_ROOT, "dev-scripts/agent/notify-developer.sh" ); test.describe("notify-developer.sh — E2EE en DM rooms", () => { test("script existe y es ejecutable", () => { expect(fs.existsSync(NOTIFY_SCRIPT)).toBe(true); const stats = fs.statSync(NOTIFY_SCRIPT); // Check executable bit (owner) expect(stats.mode & 0o100).toBeTruthy(); }); test("createRoom incluye initial_state con m.room.encryption", () => { const content = fs.readFileSync(NOTIFY_SCRIPT, "utf-8"); // Must have initial_state in the createRoom call expect(content).toContain("initial_state"); expect(content).toContain("m.room.encryption"); expect(content).toContain("m.megolm.v1.aes-sha2"); }); test("createRoom mantiene preset trusted_private_chat", () => { const content = fs.readFileSync(NOTIFY_SCRIPT, "utf-8"); expect(content).toContain("trusted_private_chat"); }); test("createRoom incluye is_direct e invite", () => { const content = fs.readFileSync(NOTIFY_SCRIPT, "utf-8"); expect(content).toContain("is_direct"); expect(content).toContain("invite"); }); });