Files
agents_and_robots/e2e/tests/notify-developer-e2ee.spec.ts
T
egutierrez 89ab05eda9 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>
2026-04-10 22:43:47 +00:00

39 lines
1.3 KiB
TypeScript

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");
});
});