From 6c5f82bb1e7a2235d4b39a859b16a5438300796a Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Fri, 4 May 2018 12:27:29 -0700 Subject: [PATCH] fix: update getByTestId types --- typings/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index f6b18831..eec3f135 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2,13 +2,14 @@ import {Simulate as ReactSimulate} from 'react-dom/test-utils' type TextMatchFunction = (content: string, element: HTMLElement) => boolean type TextMatch = string | RegExp | TextMatchFunction +type ExactTextMatch = string | RegExp | TextMatchFunction interface RenderResult { container: HTMLDivElement rerender: (ui: React.ReactElement) => void unmount: VoidFunction - queryByTestId: (id: TextMatch) => HTMLElement | null - getByTestId: (id: TextMatch) => HTMLElement + queryByTestId: (id: ExactTextMatch) => HTMLElement | null + getByTestId: (id: ExactTextMatch) => HTMLElement queryByText: (id: TextMatch) => HTMLElement | null getByText: (text: TextMatch) => HTMLElement queryByPlaceholderText: (id: TextMatch) => HTMLElement | null