mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 01:52:19 +08:00

Issue number: resolves #29991 Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
15 lines
419 B
TypeScript
15 lines
419 B
TypeScript
import { IonButton } from '@ionic/react';
|
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
import React from 'react';
|
|
|
|
test('should support onDoubleClick bindings', () => {
|
|
const mockFn = jest.fn();
|
|
|
|
render(<IonButton onDoubleClick={mockFn}>Click me</IonButton>);
|
|
|
|
// Simulate a double click on the button
|
|
fireEvent.dblClick(screen.getByText('Click me'));
|
|
|
|
expect(mockFn).toBeCalled();
|
|
});
|