From 260d1be62053d564bfd2179bb0696b636d5b3978 Mon Sep 17 00:00:00 2001 From: lironlevy Date: Mon, 4 Jul 2022 12:32:09 +0300 Subject: [PATCH 1/2] doc logTestingPlaygroundURL --- docs/queries/about.mdx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/queries/about.mdx b/docs/queries/about.mdx index 0d1a6fe5c..8c1ea8c2a 100644 --- a/docs/queries/about.mdx +++ b/docs/queries/about.mdx @@ -170,9 +170,11 @@ const inputNode1 = screen.getByLabelText('Username') const container = document.querySelector('#app') const inputNode2 = getByLabelText(container, 'Username') ``` + ### `queryOptions` -You can pass a `queryOptions` object with the query type. See the docs for each query type to see available options, e.g. [byRole API](queries/byrole.mdx#api). +You can pass a `queryOptions` object with the query type. See the docs for each +query type to see available options, e.g. [byRole API](queries/byrole.mdx#api). ### `screen` @@ -240,7 +242,8 @@ cy.findByLabelText('Example').should('exist') ## `TextMatch` Most of the query APIs take a `TextMatch` as an argument, which means the -argument can be either a _string_, _regex_, or a _function_ of signature `(content?: string, element?: Element | null) => boolean` which returns `true` +argument can be either a _string_, _regex_, or a _function_ of signature +`(content?: string, element?: Element | null) => boolean` which returns `true` for a match and `false` for a mismatch. ### TextMatch Examples @@ -370,7 +373,8 @@ screen.debug(screen.getAllByText('multi-test')) ### `screen.logTestingPlaygroundURL()` For debugging using [testing-playground](https://testing-playground.com), screen -exposes this convenient method which logs a URL that can be opened in a browser. +exposes this convenient method which logs & returns a URL that can be opened in +a browser. ```javascript import {screen} from '@testing-library/dom' From ac1bd6a459bbb2ecd048b0386d7f93b2c4d4bdba Mon Sep 17 00:00:00 2001 From: Matan Borenkraout Date: Mon, 11 Jul 2022 09:08:09 +0300 Subject: [PATCH 2/2] docs: update text for logTestingPlaygroundURL Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> --- docs/queries/about.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/queries/about.mdx b/docs/queries/about.mdx index 8c1ea8c2a..0747be78f 100644 --- a/docs/queries/about.mdx +++ b/docs/queries/about.mdx @@ -373,7 +373,7 @@ screen.debug(screen.getAllByText('multi-test')) ### `screen.logTestingPlaygroundURL()` For debugging using [testing-playground](https://testing-playground.com), screen -exposes this convenient method which logs & returns a URL that can be opened in +exposes this convenient method which logs and returns a URL that can be opened in a browser. ```javascript