const test = require('node:test');
const assert = require('node:assert/strict');

const MenuManager = require('../src/menu/index.js');

test('createEndpoint returns script including initEditor and menuData', () => {
  const manager = new MenuManager();
  const script = manager.createEndpoint('measurement', ['asset', 'logger', 'position']);

  assert.match(script, /window\.EVOLV\.nodes\.measurement\.initEditor/);
  assert.match(script, /window\.EVOLV\.nodes\.measurement\.menuData/);
});

test('_getSoftwareType resolves to string identifier', () => {
  const manager = new MenuManager();
  const softwareType = manager._getSoftwareType('measurement');

  assert.equal(typeof softwareType, 'string');
  assert.equal(softwareType, 'measurement');
});
