import assert from 'node:assert/strict';
import test from 'node:test';
import { resolvePromptFollowupMode, resolveStaticContentType } from './chat.js';

test('resolveStaticContentType returns html content type for chat resource html files', () => {
  assert.equal(resolveStaticContentType('/tmp/sample.html'), 'text/html; charset=utf-8');
  assert.equal(resolveStaticContentType('/tmp/sample.htm'), 'text/html; charset=utf-8');
});

test('resolveStaticContentType keeps plain text content type for code resources', () => {
  assert.equal(resolveStaticContentType('/tmp/sample.ts'), 'text/plain; charset=utf-8');
  assert.equal(resolveStaticContentType('/tmp/sample.diff'), 'text/plain; charset=utf-8');
});

test('resolvePromptFollowupMode defaults to queue and preserves direct mode', () => {
  assert.equal(resolvePromptFollowupMode(undefined), 'queue');
  assert.equal(resolvePromptFollowupMode(null), 'queue');
  assert.equal(resolvePromptFollowupMode('queue'), 'queue');
  assert.equal(resolvePromptFollowupMode('direct'), 'direct');
});
