diff --git a/docs/angular-testing-library/api.mdx b/docs/angular-testing-library/api.mdx index ee88c49df..774d0810d 100644 --- a/docs/angular-testing-library/api.mdx +++ b/docs/angular-testing-library/api.mdx @@ -324,9 +324,9 @@ const component = await render(AppComponent) const componentInstance = component.fixture.componentInstance as AppComponent ``` -> 🚨 If you find yourself using `fixture` to access the component's internal -> values you should reconsider! This probable means, you're testing -> implementation details. +:::danger If you find yourself using `fixture` to access the component's +internal values you should reconsider! This probable means, you're testing +implementation details. ::: ### `navigate` diff --git a/docs/angular-testing-library/examples.mdx b/docs/angular-testing-library/examples.mdx index c4eee4601..812e60705 100644 --- a/docs/angular-testing-library/examples.mdx +++ b/docs/angular-testing-library/examples.mdx @@ -4,9 +4,9 @@ title: Examples sidebar_label: Examples --- -> Read -> [Good testing practices with 🦔 Angular Testing Library](https://timdeschryver.dev/posts/good-testing-practices-with-angular-testing-library) -> for a guided example +:::info Read +[Good testing practices with 🦔 Angular Testing Library](https://timdeschryver.dev/posts/good-testing-practices-with-angular-testing-library) +for a guided example ::: counter.component.ts diff --git a/docs/cypress-testing-library/intro.mdx b/docs/cypress-testing-library/intro.mdx index ec1135944..395c485fa 100644 --- a/docs/cypress-testing-library/intro.mdx +++ b/docs/cypress-testing-library/intro.mdx @@ -26,11 +26,11 @@ You can now use all of `DOM Testing Library`'s `findBy`, `findAllBy`, `queryBy` and `queryAllBy` commands off the global `cy` object. [See the `DOM Testing Library` docs for reference](https://testing-library.com/docs/dom-testing-library/api-queries). -> Note: the `get*` queries are not supported because for reasonable Cypress -> tests you need retryability and `find*` queries already support that. `query*` -> queries are no longer necessary since v5 and will be removed in v6. `find*` -> fully support built-in Cypress assertions (removes the only use-case for -> `query*`). +:::caution the `get*` queries are not supported because for reasonable Cypress +tests you need retryability and `find*` queries already support that. `query*` +queries are no longer necessary since v5 and will be removed in v6. `find*` +fully support built-in Cypress assertions (removes the only use-case for +`query*`). ::: ## With TypeScript diff --git a/docs/dom-testing-library/api-events.mdx b/docs/dom-testing-library/api-events.mdx index cbd2a96fa..4a68a256d 100644 --- a/docs/dom-testing-library/api-events.mdx +++ b/docs/dom-testing-library/api-events.mdx @@ -6,9 +6,11 @@ title: Firing Events import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' -> Most projects have a few use cases for `fireEvent`, but the majority of the -> time you should probably use -> [`@testing-library/user-event`](https://github.com/testing-library/user-event). +:::tip +Most projects have a few use cases for `fireEvent`, but the majority of the +time you should probably use +[`@testing-library/user-event`](https://github.com/testing-library/user-event). +::: ## `fireEvent` diff --git a/docs/dom-testing-library/api-helpers.mdx b/docs/dom-testing-library/api-helpers.mdx index c749d1c3e..5791bb520 100644 --- a/docs/dom-testing-library/api-helpers.mdx +++ b/docs/dom-testing-library/api-helpers.mdx @@ -57,11 +57,11 @@ module.exports = { } ``` -> **Note** -> -> Custom queries can be added to `React Testing Library`'s `render` method by -> adding `queries` to the options config object. See the render -> [options](react-testing-library/api.mdx#render-options). +:::info +Custom queries can be added to `React Testing Library`'s `render` method by +adding `queries` to the options config object. See the render +[options](react-testing-library/api.mdx#render-options). +::: ## `buildQueries` diff --git a/docs/dom-testing-library/api-queries.mdx b/docs/dom-testing-library/api-queries.mdx index 7608daa80..af44b42fe 100644 --- a/docs/dom-testing-library/api-queries.mdx +++ b/docs/dom-testing-library/api-queries.mdx @@ -8,8 +8,10 @@ import TabItem from '@theme/TabItem' ## Variants -> `getBy` queries are shown by default in the [query documentation](#queries) -> below. +:::info +`getBy` queries are shown by default in the [query documentation](#queries) +below. +::: ### getBy @@ -41,12 +43,12 @@ matches the given query. The promise is rejected if no element is found or if more than one element is found after a default timeout of `1000`ms. If you need to find more than one element, then use `findAllBy`. -> **Note** -> -> this is a simple combination of `getBy*` queries and -> [`waitFor`](api-async.mdx#waitfor). The `findBy*` queries accept the `waitFor` -> options as the last argument. (i.e. -> `screen.findByText('text', queryOptions, waitForOptions)`) +:::info +this is a simple combination of `getBy*` queries and +[`waitFor`](api-async.mdx#waitfor). The `findBy*` queries accept the `waitFor` +options as the last argument. (i.e. +`screen.findByText('text', queryOptions, waitForOptions)`) +::: ### findAllBy @@ -87,16 +89,16 @@ document.body.innerHTML = exampleHTML const exampleInput = screen.getByLabelText(/example/i) ``` -> **Note** -> -> You need a global DOM environment to use `screen`. If you're using jest, with -> the -> [testEnvironment](https://jestjs.io/docs/en/configuration#testenvironment-string) -> set to `jsdom`, a global DOM environment will be available for you. -> -> If you're loading your test with a `script` tag, make sure it comes after the -> `body`. An example can be seen -> [here](https://github.com/testing-library/dom-testing-library/issues/700#issuecomment-692218886). +:::caution +You need a global DOM environment to use `screen`. If you're using jest, with +the +[testEnvironment](https://jestjs.io/docs/en/configuration#testenvironment-string) +set to `jsdom`, a global DOM environment will be available for you. + +If you're loading your test with a `script` tag, make sure it comes after the +`body`. An example can be seen +[here](https://github.com/testing-library/dom-testing-library/issues/700#issuecomment-692218886). +::: ### `screen.debug` @@ -143,14 +145,14 @@ screen.logTestingPlaygroundURL(screen.getByText('test')) ## Queries -> **Note** -> -> These queries are the base queries and require you to pass a `container` as -> the first argument. Most framework-implementations of Testing Library provide -> a pre-bound version of these queries when you render your components with them -> which means you do not have to provide a container. In addition, if you just -> want to query `document.body` then you can use the [`screen`](#screen) export -> as demonstrated above (using `screen` is recommended). +:::info +These queries are the base queries and require you to pass a `container` as +the first argument. Most framework-implementations of Testing Library provide +a pre-bound version of these queries when you render your components with them +which means you do not have to provide a container. In addition, if you just +want to query `document.body` then you can use the [`screen`](#screen) export +as demonstrated above (using `screen` is recommended). +::: ### `ByLabelText` @@ -256,10 +258,10 @@ If it is important that you query an actual `