From ca5bf9a7a97e415980bd304739760a334b2c38da Mon Sep 17 00:00:00 2001 From: Cee Chen <549407+cee-chen@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:16:06 -0700 Subject: [PATCH] [wiki] RTL docs update (#7199) --- wiki/contributing-to-eui/testing/unit-testing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/contributing-to-eui/testing/unit-testing.md b/wiki/contributing-to-eui/testing/unit-testing.md index 3de2f282d2e..edd89ba3110 100644 --- a/wiki/contributing-to-eui/testing/unit-testing.md +++ b/wiki/contributing-to-eui/testing/unit-testing.md @@ -35,6 +35,7 @@ The [`src/test`](../../../src/test) module exports some functions and constants * `shouldRenderCustomStyles` automatically asserts that consumer classNames, Emotion CSS, and custom styles are merged correctly with EUI's styles. * RTL: * The exports within `test/rtl` (`render`, `screen`, and `within`) provide out-of-the-box `data-test-subj` querying. `render` provides automatic `EuiProvider` wrapping. + * _Note:_ Unlike RTL's recommendation to [use `screen` for queries](https://testing-library.com/docs/queries/about/#using-queries), EUI prefers, for consistency, to destructure test queries from the `render()` API. * Enzyme: * `findTestSubject` helps you find DOM nodes in mounted components. * `takeMountedSnapshot` generates a snapshot of a mounted component.