/** * US-26 — Admin/redteam creates and manages simulation templates. * Covers AC-26.3 → AC-26.8 (API CRUD + UI). * AC-26.1/2 (model + migration) tested implicitly via API assertions. */ import { test, expect } from '@playwright/test'; import { adminToken, deleteUserByUsername, ensureUser, login, makeClient, } from '../fixtures/api'; import { seedTokenInStorage } from '../fixtures/auth'; const REDTEAM_USER = 'us26-redteam'; const SOC_USER = 'us26-soc'; const PASS = 'us26-pass-strong'; interface Template { id: number; name: string; description: string | null; commands: string | null; prerequisites: string | null; techniques: { id: string; name: string }[]; tactics: { id: string; name: string }[]; created_at: string; updated_at: string | null; created_by: { id: number; username: string }; } async function createTemplate( token: string, payload: { name: string; description?: string; commands?: string; technique_ids?: string[]; tactic_ids?: string[] }, ): Promise