Skip to content

Commit 6f1205c

Browse files
committed
fix: flacky test
1 parent e1c08a8 commit 6f1205c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/index.spec.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,18 @@ test('Should only bottomRight is resizable and call onResizeStart when mousedown
272272
expect(onResizeStart.getCall(0).args[1]).toBe('bottomRight');
273273
});
274274

275-
// TODO: This test is so flaky.
276-
// test('Should not begin resize when onResizeStart returns false', async ({ mount, page }) => {
277-
// const onResizeStart = () => {
278-
// return false;
279-
// };
280-
// const onResize = spy();
281-
// const resizable = await mount(<Resizable onResizeStart={onResizeStart} onResize={onResize} />);
282-
// const divs = resizable.locator('div');
283-
// await (await divs.all())[1].dispatchEvent('mousedown');
284-
// await page.mouse.move(100, 200);
285-
// expect(onResize.callCount).toBe(0);
286-
// });
275+
test('Should not begin resize when onResizeStart returns false', async ({ mount, page }) => {
276+
const onResizeStart = () => {
277+
return false;
278+
};
279+
const onResize = spy();
280+
const resizable = await mount(<Resizable onResizeStart={onResizeStart} onResize={onResize} />);
281+
const divs = resizable.locator('div');
282+
await (await divs.all())[1].dispatchEvent('mousedown');
283+
await page.mouse.move(100, 200);
284+
await page.mouse.up();
285+
expect(onResize.callCount).toBe(0);
286+
});
287287

288288
// test('should call onResize with expected args when resize direction right', async ({ mount, page }) => {
289289
// const onResize = spy();

0 commit comments

Comments
 (0)