Skip to content

Commit fa9f855

Browse files
committed
test: add test case
1 parent 2122586 commit fa9f855

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/basic.test.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,7 @@ describe('Trigger.Basic', () => {
371371
describe('children renderProps', () => {
372372
it('should get current open', () => {
373373
const { container } = render(
374-
<Trigger
375-
popupVisible={true}
376-
popup={<span>Hello!</span>}
377-
>
374+
<Trigger popupVisible={true} popup={<span>Hello!</span>}>
378375
{({ open }) => <button>{String(open)}</button>}
379376
</Trigger>,
380377
);
@@ -994,6 +991,16 @@ describe('Trigger.Basic', () => {
994991
expect(document.querySelector('.rc-trigger-popup-hidden')).toBeTruthy();
995992
});
996993

994+
it('defaultPopupVisible should work', async () => {
995+
render(
996+
<Trigger defaultPopupVisible>
997+
<div className="target" />
998+
</Trigger>,
999+
);
1000+
1001+
expect(document.querySelector('.rc-trigger-popup')).toBeTruthy();
1002+
});
1003+
9971004
describe('click window to hide', () => {
9981005
it('should hide', async () => {
9991006
const onOpenChange = jest.fn();

0 commit comments

Comments
 (0)