From d313a8efaf99c20981cb5503f2ea4568ebe7252d Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Tue, 31 Jul 2018 05:29:59 -0400 Subject: [PATCH] Replace getElementByText with getByText --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6c03204..ea0d5830 100644 --- a/README.md +++ b/README.md @@ -506,12 +506,12 @@ for a full list as well as default `eventProperties`. ```javascript import {render, fireEvent} from 'react-testing-library' -const {getElementByText} = render(
) +const {getByText} = render() // similar to the above example // click will bubble for React to see it const rightClick = {button: 2} -fireEvent.click(getElementByText('Submit'), rightClick) +fireEvent.click(getByText('Submit'), rightClick) // default `button` property for click events is set to `0` which is a left click. ```