import assert from 'node:assert/strict';
import test from 'node:test';

import {
  DEFAULT_NPC_DISPOSITION,
  normalizeNpcDisposition,
  npcDispositionRingColor,
  otherNpcDispositions,
} from './npcDisposition';

void test('normalizeNpcDisposition defaults to neutral', () => {
  assert.equal(normalizeNpcDisposition(undefined), DEFAULT_NPC_DISPOSITION);
  assert.equal(normalizeNpcDisposition('hostile'), 'hostile');
  assert.equal(normalizeNpcDisposition('friendly'), 'friendly');
  assert.equal(normalizeNpcDisposition('nope'), 'neutral');
});

void test('npcDispositionRingColor and inactive', () => {
  assert.equal(npcDispositionRingColor('hostile'), '#e53935');
  assert.equal(npcDispositionRingColor('neutral'), '#c9a227');
  assert.equal(npcDispositionRingColor('friendly'), '#43a047');
  assert.equal(npcDispositionRingColor('hostile', true), '#9e9e9e');
});

void test('otherNpcDispositions hides current', () => {
  assert.deepEqual(otherNpcDispositions('neutral'), ['hostile', 'friendly']);
  assert.deepEqual(otherNpcDispositions('hostile'), ['neutral', 'friendly']);
});
