Files
Baptiste Lyet 0152b900ef docs: reword . in parents to (the root document) (#41689)
* docs(parents) : reword . to the root document

* docs(parents) : ensure .foo parents is well displayed and not transformed as with the single .
2026-03-05 12:12:06 +00:00

29 lines
1.1 KiB
TypeScript

import { formatCell } from '../utils.ts';
describe('tools/docs/test/utils', () => {
it('parents row header should be a td block', () => {
const parentsRowHeader = formatCell(
['parents', '.,package,test,ansible'],
0,
);
expect(parentsRowHeader).toEqual('<td>parents</td>');
});
it('parents content should be multiple code blocks, and . be display with "(the root document)"', () => {
const parents = formatCell(['parents', '.,packageRules,argocd,ansible'], 1);
expect(parents).toEqual(
'<td class="parents"><span><code>(the root document)</code></span><span><code>ansible</code></span><span><code>argocd</code></span><span><code>packageRules</code></span></td>',
);
});
it('parent named ".foo" should be not display with ".foo (the root document)"', () => {
const parents = formatCell(
['parents', '.foo,packageRules,argocd,ansible'],
1,
);
expect(parents).toEqual(
'<td class="parents"><span><code>.foo</code></span><span><code>ansible</code></span><span><code>argocd</code></span><span><code>packageRules</code></span></td>',
);
});
});