fix(admin): draw no divider under an addon whose sub-rows render nothing

A switched-off booking mail import passed false as its only child, which Children.count counts, so an empty list with a top border showed under the row.
This commit is contained in:
Maurice
2026-11-23 14:56:08 +01:00
parent fa8e1b68bd
commit ba45dbc874
2 changed files with 24 additions and 1 deletions
@@ -0,0 +1,23 @@
// FE-ADMIN-ADDONTILE-001
import { describe, expect, it } from 'vitest';
import { render } from '../../../tests/helpers/render';
import AddonTile from './AddonTile';
describe('AddonTile', () => {
it('FE-ADMIN-ADDONTILE-001: sub-rows that render nothing draw no list and no line', () => {
const off = false;
const { container, rerender } = render(
<AddonTile icon={null} name="Booking mails" enabled={false}>
{off && <li>Set up</li>}
</AddonTile>
);
expect(container.querySelector('ul')).toBeNull();
rerender(
<AddonTile icon={null} name="Booking mails" enabled>
{null}
<li>Set up</li>
</AddonTile>
);
expect(container.querySelectorAll('ul > li')).toHaveLength(1);
});
});