mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
ba45dbc874
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.
24 lines
753 B
TypeScript
24 lines
753 B
TypeScript
// 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);
|
|
});
|
|
});
|