Skip to content

Commit 907e798

Browse files
committed
test: add test case
1 parent fe92579 commit 907e798

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/basic.test.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,22 @@ describe('Trigger.Basic', () => {
368368
});
369369
});
370370

371+
describe('children renderProps', () => {
372+
it('should get current open', () => {
373+
const { container } = render(
374+
<Trigger
375+
popupVisible={true}
376+
popup={<span>Hello!</span>}
377+
>
378+
{({ open }) => <button>{String(open)}</button>}
379+
</Trigger>,
380+
);
381+
382+
const button = container.querySelector('button');
383+
expect(button.textContent).toBe('true');
384+
});
385+
});
386+
371387
describe('destroyPopupOnHide', () => {
372388
it('defaults to false', () => {
373389
const { container } = render(

0 commit comments

Comments
 (0)