import test from 'node:test';import assert from 'node:assert/strict';import {previewStaffMigration} from '../node/staff-bureau-migration.mjs'; test('legacy staff candidates are advisory and never applied',()=>{const p=previewStaffMigration({id:'x',role:'staff'});assert.equal(p.applied,false);assert.equal(p.mode,'shadow');assert.equal(p.requiresOwnerReview,true);}); test('service identity cannot silently become owner',()=>{const p=previewStaffMigration({id:'svc',ranks:['official_account','owners']});assert.equal(p.candidate,null);assert.equal(p.ambiguous,true);}); test('conflicting departments require manual review',()=>{const p=previewStaffMigration({id:'x',ranks:['web_dev','web_support']});assert.equal(p.ambiguous,true);assert.equal(p.candidate,null);}); test('known department produces reviewable candidate',()=>{const p=previewStaffMigration({id:'x',ranks:['web_support']});assert.deepEqual(p.candidate,{department:'community_moderation',level:'staff'});}); test('unknown roles do not gain staff authority',()=>{const p=previewStaffMigration({id:'x',role:'player'});assert.equal(p.candidate,null);});