',
);
expect(out).toContain('Compiled but Risky 4');
expect(out).toContain('');
expect(out).toContain('
');
// Collapsed by default (no open attribute).
expect(out).not.toContain('data-count="4" open');
});
it('html adds the open attribute when defaultOpen is set', () => {
const out = render('html', f => {
f.foldableSection({ title: 'Summary', count: 3, defaultOpen: true }, () => f.line('x'));
});
expect(out).toContain('id="summary" data-title="Summary" data-count="3" open>');
});
it('html omits the badge when count is undefined', () => {
const out = render('html', f => {
f.foldableSection({ title: 'Notes' }, () => f.line('x'));
});
expect(out).toContain('