From e91fb71f28b8886799b31efa144e72fcad2e1d2c Mon Sep 17 00:00:00 2001 From: Rahim Alwer Date: Mon, 14 Oct 2019 20:47:01 +1100 Subject: [PATCH 1/2] docs(svelte): remove warning on using component from rendered results and provide use cases --- docs/svelte-testing-library/api.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/svelte-testing-library/api.md b/docs/svelte-testing-library/api.md index c2673c8f8..2d675f75e 100644 --- a/docs/svelte-testing-library/api.md +++ b/docs/svelte-testing-library/api.md @@ -50,14 +50,14 @@ Please refer to the ### Results -| Result | Description | -| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `container` | The HTML element the component is mounted into. | -| `component` | The newly created Svelte component. **Please do not use this, it will most likely be removed in a future release.** Using this method goes against the testing libraries guiding principles. | -| `debug` | Logs the baseElement using [prettyDom](https://testing-library.com/docs/dom-testing-library/api-helpers#prettydom). | -| `unmount` | Unmounts the component from the `target` by calling `component.$destroy()`. | -| `rerender` | Calls render again destroying the old component, and mounting the new component on the original `target` with any new options passed in. | -| `...queries` | Returns all [query functions](https://testing-library.com/docs/dom-testing-library/api-queries) that are binded to the `container`. If you pass in `query` arguments than this will be those, otherwise all. | +| Result | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `container` | The HTML element the component is mounted into. | +| `component` | The newly created Svelte component. This is mostly useful for testing exported functions or cases where manipulating the DOM doesn't fit. Outside of said cases avoid using the component directly to build tests, instead of interacting with the rendered Svelte component, work with the DOM . | +| `debug` | Logs the baseElement using [prettyDom](https://testing-library.com/docs/dom-testing-library/api-helpers#prettydom). | +| `unmount` | Unmounts the component from the `target` by calling `component.$destroy()`. | +| `rerender` | Calls render again destroying the old component, and mounting the new component on the original `target` with any new options passed in. | +| `...queries` | Returns all [query functions](https://testing-library.com/docs/dom-testing-library/api-queries) that are binded to the `container`. If you pass in `query` arguments than this will be those, otherwise all. | ## `cleanup` From 01b0a5f2153d3d37f51c41eee518996d2898462c Mon Sep 17 00:00:00 2001 From: Rahim Alwer Date: Mon, 14 Oct 2019 20:48:16 +1100 Subject: [PATCH 2/2] docs(svelte): debug description mentions wrong element --- docs/svelte-testing-library/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/svelte-testing-library/api.md b/docs/svelte-testing-library/api.md index 2d675f75e..65182e627 100644 --- a/docs/svelte-testing-library/api.md +++ b/docs/svelte-testing-library/api.md @@ -54,7 +54,7 @@ Please refer to the | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `container` | The HTML element the component is mounted into. | | `component` | The newly created Svelte component. This is mostly useful for testing exported functions or cases where manipulating the DOM doesn't fit. Outside of said cases avoid using the component directly to build tests, instead of interacting with the rendered Svelte component, work with the DOM . | -| `debug` | Logs the baseElement using [prettyDom](https://testing-library.com/docs/dom-testing-library/api-helpers#prettydom). | +| `debug` | Logs the `container` using [prettyDom](https://testing-library.com/docs/dom-testing-library/api-helpers#prettydom). | | `unmount` | Unmounts the component from the `target` by calling `component.$destroy()`. | | `rerender` | Calls render again destroying the old component, and mounting the new component on the original `target` with any new options passed in. | | `...queries` | Returns all [query functions](https://testing-library.com/docs/dom-testing-library/api-queries) that are binded to the `container`. If you pass in `query` arguments than this will be those, otherwise all. |