// Generated, do not edit. sha256:a7ea6b1b573eee126d96f50fe1a254b6a09a05cea53026a6d40a986ee55bbb21 import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; const { emptyStateHtml } = await import('../../client/ui/empty-state.js'); describe('emptyStateHtml: the three parts', () => { it('renders the bare form as one line, without a frame or an icon', () => { const html = emptyStateHtml('Nog geen trades.'); assert.equal(html, '
Nog geen trades.
'); assert.doesNotMatch(html, /alert|icon|svg/); }); it('puts the reason behind the message, muted', () => { const html = emptyStateHtml('Nog geen trades.', { why: 'Voeg eerst een asset toe.' }); assert.match(html, /Nog geen trades\. Voeg eerst een asset toe\.<\/span>/); }); it('adds the link last, so you read what is missing before where to fix it', () => { const html = emptyStateHtml('Nog geen trades.', { href: '#/system/assets', linkText: 'Assets beheren' }); assert.match(html, /Nog geen trades\. Assets beheren<\/a><\/div>$/); }); }); describe('emptyStateHtml: what is left out leaves nothing behind', () => { it('writes no span when there is no reason', () => { assert.doesNotMatch(emptyStateHtml('Leeg.'), /span/); }); it('writes no anchor when only one half of the link is given', () => { assert.doesNotMatch(emptyStateHtml('Leeg.', { href: '#/x' }), / { assert.equal(emptyStateHtml('Leeg.'), '
Leeg.
'); }); }); describe('emptyStateHtml: everything is text', () => { it('escapes the message', () => { assert.doesNotMatch(emptyStateHtml(''), / { assert.doesNotMatch(emptyStateHtml('x', { why: '' }), /