Skip to content

Commit dd7ece8

Browse files
committed
test: update snapshot
1 parent aef5eb7 commit dd7ece8

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/basic.test.jsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,7 @@ describe('Trigger.Basic', () => {
561561
it(`${
562562
mockRect ? 'offset' : 'getBoundingClientRect'
563563
}: ${prop}`, async () => {
564-
const onPopupAlign = jest.fn(() => {
565-
expect(rectCalled).toBeTruthy();
566-
});
564+
const onPopupAlign = jest.fn();
567565

568566
const { container } = createTrigger(prop, {
569567
onPopupAlign,
@@ -573,15 +571,15 @@ describe('Trigger.Basic', () => {
573571
expect(rectCalled).toBeFalsy();
574572
expect(onPopupAlign).not.toHaveBeenCalled();
575573

574+
// Click will trigger `onPrepare` which need measure target size
576575
fireEvent.click(container.querySelector('.target'));
577-
for (let i = 0; i < 10; i += 1) {
578-
await act(async () => {
579-
jest.advanceTimersByTime(100);
580-
await Promise.resolve();
581-
});
582-
}
583-
584576
expect(rectCalled).toBeTruthy();
577+
578+
// Flush for motion
579+
await act(async () => {
580+
jest.advanceTimersByTime(100);
581+
await Promise.resolve();
582+
});
585583
expect(onPopupAlign).toHaveBeenCalled();
586584

587585
expect(

0 commit comments

Comments
 (0)