import assert from "node:assert/strict" import {test} from "node:test" import {parseDashboardGre,parseDashboardWireGuard,parseDashboardVxlan} from "./dashboard-overlays" import {dashboardGre,dashboardWg,dashboardVxlan} from "../tests/e2e/fixtures/dashboard-overlays" for(const [kind,parse,key,row] of [["GRE",parseDashboardGre,"tunnels",dashboardGre],["VXLAN",parseDashboardVxlan,"tunnels",dashboardVxlan],["WG",parseDashboardWireGuard,"interfaces",dashboardWg]] as const)test("strict complete dashboard overlay catalog/"+kind,()=>{ assert.ok(parse({[key]:[row],failures:[]}));assert.ok(parse({[key]:[],failures:[]})) for(const raw of [{},{[key]:[]},{[key]:[{}],failures:[]},{[key]:[row,row],failures:[]},{[key]:[{...row,status:"unknown"}],failures:[]},{[key]:[row],failures:[{serverId:"2",error:"timeout"}]}])assert.throws(()=>parse(raw)) })