import assert from 'node:assert/strict';
import test from 'node:test';
import { hasOpsRole, opsInternals } from './plaza-ops.mjs';

test('hasOpsRole respects role hierarchy', () => {
  assert.equal(hasOpsRole('ops_admin', 'reviewer'), true);
  assert.equal(hasOpsRole('editor', 'reviewer'), true);
  assert.equal(hasOpsRole('reviewer', 'editor'), false);
  assert.equal(hasOpsRole('none', 'reviewer'), false);
});

test('REPORT_REASONS contains documented values', () => {
  assert.ok(opsInternals.REPORT_REASONS.has('spam'));
  assert.ok(opsInternals.REPORT_REASONS.has('other'));
});

test('FEATURED_POSITIONS contains homepage and trending', () => {
  assert.ok(opsInternals.FEATURED_POSITIONS.has('homepage_banner'));
  assert.ok(opsInternals.FEATURED_POSITIONS.has('trending'));
  assert.ok(opsInternals.FEATURED_POSITIONS.has('category_top'));
});
