From 89ab05eda91877d4dd5685b501a6173f4fbc8d20 Mon Sep 17 00:00:00 2001 From: Enmanuel Date: Fri, 10 Apr 2026 22:43:47 +0000 Subject: [PATCH] test: E2E test para E2EE en notify-developer.sh Valida que el script notify-developer.sh crea DM rooms con encriptacion habilitada: initial_state con m.room.encryption, algoritmo m.megolm.v1.aes-sha2, preset trusted_private_chat, is_direct e invite presentes. Co-Authored-By: Claude Opus 4.6 (1M context) --- e2e/tests/notify-developer-e2ee.spec.ts | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 e2e/tests/notify-developer-e2ee.spec.ts diff --git a/e2e/tests/notify-developer-e2ee.spec.ts b/e2e/tests/notify-developer-e2ee.spec.ts new file mode 100644 index 0000000..a7a98b6 --- /dev/null +++ b/e2e/tests/notify-developer-e2ee.spec.ts @@ -0,0 +1,38 @@ +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"); + }); +});