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) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 22:43:47 +00:00
parent 3f9425211c
commit 89ab05eda9
+38
View File
@@ -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");
});
});