import { describe, test, expect } from 'vitest'; import { NumberCounter } from './NumberCounter'; const toHtml = (NumberCounter as any).toHtml; const counters = [ { number: 150, suffix: '+', label: 'Projects' }, { number: 50, suffix: '+', label: 'Clients' }, ]; describe('NumberCounter.toHtml deterministic + unique scope ids (thread node id, no Math.random)', () => { test('same node id -> identical output across calls (deterministic)', () => { const { html: html1 } = toHtml({ counters }, '', 'node-nc1'); const { html: html2 } = toHtml({ counters }, '', 'node-nc1'); expect(html1).toBe(html2); }); test('different node ids -> distinct, non-colliding nc_ scopes (identical props, no collision)', () => { const { html: html1 } = toHtml({ counters }, '', 'node-nc1'); const { html: html2 } = toHtml({ counters }, '', 'node-nc2'); const wrapId1 = html1.match(/