MC/website/tests/staff-bureau-seals.test.mjs
2026-11-27 23:43:05 +00:00

5 lines
877 B
JavaScript

import test from 'node:test';import assert from 'node:assert/strict';import {STAFF_DEPARTMENT_SEALS,departmentSealFor,ticketClosureAwards} from '../node/staff-bureau-seals.mjs';
test('all four staff departments have assigned seals',()=>{assert.equal(Object.keys(STAFF_DEPARTMENT_SEALS).length,4);for(const seal of Object.values(STAFF_DEPARTMENT_SEALS))assert.match(seal.seal,/^\/assets\/seals\/.+\.png$/);});
test('suspended members do not display active department seal',()=>assert.equal(departmentSealFor({department:'operations',status:'suspended'}),null));
test('verified 25 ticket closures earn department service seal',()=>{const awards=ticketClosureAwards({departments:{support:25,'ban-appeals':24}});assert.equal(awards.length,1);assert.equal(awards[0].key,'support');});
test('no closure stats never invent awards',()=>assert.deepEqual(ticketClosureAwards(null),[]));