web/website/tests/dev-request-catalogue.test.mjs
2026-11-21 20:22:37 +01:00

9 lines
876 B
JavaScript

import test from 'node:test';import assert from 'node:assert/strict';import{readFileSync}from'node:fs';
import {devRequestCatalogue} from '../scripts/export-dev-request-catalogue.mjs';
test('staff request fields use the current public master catalogue without developer issuance',()=>{
const catalogue=devRequestCatalogue();assert.ok(catalogue.actions.length>0);
assert.equal(new Set(catalogue.actions.map(a=>a.id)).size,catalogue.actions.length);
assert.equal(catalogue.actions.some(a=>/dev/i.test(a.keyType)),false);
const account=catalogue.actions.find(a=>a.id==='accounts.test-minecraft-identity');assert.ok(account);assert.ok(account.fields.some(f=>f.name==='accountName'));
assert.deepEqual(JSON.parse(readFileSync(new URL('../integrations/osticket/dev-jarvis-catalogue.json',import.meta.url))),catalogue,'Regenerate catalogue after changing mastertemplates');
});