ghost-portal/packages/page-bounties/test/utils/clickElementWithText.ts
2022-01-01 09:30:15 +02:00

11 lines
365 B
TypeScript

// Copyright 2017-2022 @polkadot/app-bounties authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { fireEvent } from '@testing-library/react';
export const clickElementWithText = async (text: string, findByText: (name: string) => Promise<HTMLElement>): Promise<void> => {
const element = await findByText(text);
fireEvent.click(element);
};