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

import { sceneGridTokenFitFactor } from './sceneGrid';

void test('sceneGridTokenFitFactor: square and disabled = 1', () => {
  assert.equal(sceneGridTokenFitFactor(undefined), 1);
  assert.equal(sceneGridTokenFitFactor({ enabled: false, type: 'hex' }), 1);
  assert.equal(sceneGridTokenFitFactor({ enabled: true, type: 'square' }), 1);
});

void test('sceneGridTokenFitFactor: hex uses inscribed diameter', () => {
  assert.ok(Math.abs(sceneGridTokenFitFactor({ enabled: true, type: 'hex' }) - Math.sqrt(3) / 2) < 1e-9);
});
