import assert from 'node:assert/strict';
import test from 'node:test';
import { getOrCreateIdentityTabRoot } from '@open-matrix/federation/tab_realm';

test('identity tab root uses the app name as the middle segment', () => {
  const root = getOrCreateIdentityTabRoot('director', 'test-user-1');

  assert.match(root, /^test-user-1\.DIRECTOR\.SESSION-[A-Z0-9]{8}$/);
  assert.equal(root.includes('SPACE-HIVECAST'), false);
});
