Skip to content

Commit a6b031a

Browse files
committed
test: cover dropdown forwarded ref
1 parent 6284462 commit a6b031a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/basic.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ describe('dropdown', () => {
9999
expect(onVisibleChange).toHaveBeenCalledWith(false);
100100
});
101101

102+
it('forwards ref to trigger', () => {
103+
const ref = createRef<any>();
104+
const { container } = render(
105+
<Dropdown ref={ref} overlay={<div>Test</div>}>
106+
<button className="my-button">open</button>
107+
</Dropdown>,
108+
);
109+
110+
expect(ref.current.nativeElement).toBe(
111+
container.querySelector('.my-button'),
112+
);
113+
});
114+
102115
it('simply works', async () => {
103116
let clicked;
104117

0 commit comments

Comments
 (0)