From 0bcdfcae848eaf6835ccf86eb49dde395fd8a197 Mon Sep 17 00:00:00 2001 From: Andrew <35735666+meatnordrink@users.noreply.github.com> Date: Fri, 1 Jul 2022 11:37:44 -0400 Subject: [PATCH 1/6] Clarifying user-event scope --- docs/user-event/intro.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/user-event/intro.mdx b/docs/user-event/intro.mdx index a56a94ac0..fa755edb5 100644 --- a/docs/user-event/intro.mdx +++ b/docs/user-event/intro.mdx @@ -42,7 +42,9 @@ factors in that the browser e.g. wouldn't let a user click a hidden element or type in a disabled text box. This is [why you should use `user-event`](https://ph-fritsche.github.io/blog/post/why-userevent) -to test interaction with your components. +to test interaction with your components. + +There are some user interactions that can't yet be described with `user-event`, for which `fire-event` is necessary. ## Writing tests with `userEvent` From d9f3fe69ee9bcc33cac43aa0b60c45783299c987 Mon Sep 17 00:00:00 2001 From: Andrew <35735666+meatnordrink@users.noreply.github.com> Date: Fri, 1 Jul 2022 11:45:09 -0400 Subject: [PATCH 2/6] Tweaking --- docs/user-event/intro.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-event/intro.mdx b/docs/user-event/intro.mdx index fa755edb5..c3e210105 100644 --- a/docs/user-event/intro.mdx +++ b/docs/user-event/intro.mdx @@ -44,7 +44,7 @@ This is [why you should use `user-event`](https://ph-fritsche.github.io/blog/post/why-userevent) to test interaction with your components. -There are some user interactions that can't yet be described with `user-event`, for which `fire-event` is necessary. +There are, however, some user interactions that can't yet be described with `user-event`, for which `fire-event` is necessary. ## Writing tests with `userEvent` From fe00a7b7cbed24d1a5d685f3f3947d9bd06ab977 Mon Sep 17 00:00:00 2001 From: Andrew <35735666+meatnordrink@users.noreply.github.com> Date: Tue, 5 Jul 2022 06:15:16 -0400 Subject: [PATCH 3/6] Giving an example --- docs/user-event/intro.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-event/intro.mdx b/docs/user-event/intro.mdx index c3e210105..c3ebecaf1 100644 --- a/docs/user-event/intro.mdx +++ b/docs/user-event/intro.mdx @@ -44,7 +44,7 @@ This is [why you should use `user-event`](https://ph-fritsche.github.io/blog/post/why-userevent) to test interaction with your components. -There are, however, some user interactions that can't yet be described with `user-event`, for which `fire-event` is necessary. +There are, however, some user interactions that can't yet be described with `user-event` - selecting values on a slider, for example - for which `fire-event` is necessary. ## Writing tests with `userEvent` From 2c8b919e78f407c952c89172fdbaf3624bda6f3a Mon Sep 17 00:00:00 2001 From: Andrew <35735666+meatnordrink@users.noreply.github.com> Date: Thu, 7 Jul 2022 06:01:04 -0400 Subject: [PATCH 4/6] Update docs/user-event/intro.mdx Implementing CR suggestion Co-authored-by: Philipp Fritsche --- docs/user-event/intro.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/user-event/intro.mdx b/docs/user-event/intro.mdx index c3ebecaf1..e9ffc6bde 100644 --- a/docs/user-event/intro.mdx +++ b/docs/user-event/intro.mdx @@ -44,7 +44,8 @@ This is [why you should use `user-event`](https://ph-fritsche.github.io/blog/post/why-userevent) to test interaction with your components. -There are, however, some user interactions that can't yet be described with `user-event` - selecting values on a slider, for example - for which `fire-event` is necessary. +There are, however, some user interactions or aspects of these [that aren't yet implemented and thus can't yet be described with `user-event`](https://github.com/testing-library/user-event/issues?q=is%3Aopen+label%3Aaccuracy%2Cenhancement). +In these cases you can use `fireEvent` to dispatch the concrete events that your software relies on. ## Writing tests with `userEvent` From 946914ed9f09735ad8e8c10e73a114a8b92fa7b4 Mon Sep 17 00:00:00 2001 From: Andrew <35735666+meatnordrink@users.noreply.github.com> Date: Thu, 7 Jul 2022 06:02:22 -0400 Subject: [PATCH 5/6] Adding suggested change from CR --- docs/user-event/intro.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/user-event/intro.mdx b/docs/user-event/intro.mdx index e9ffc6bde..8b73d9afd 100644 --- a/docs/user-event/intro.mdx +++ b/docs/user-event/intro.mdx @@ -47,6 +47,9 @@ to test interaction with your components. There are, however, some user interactions or aspects of these [that aren't yet implemented and thus can't yet be described with `user-event`](https://github.com/testing-library/user-event/issues?q=is%3Aopen+label%3Aaccuracy%2Cenhancement). In these cases you can use `fireEvent` to dispatch the concrete events that your software relies on. +Note that this makes your component and/or test reliant upon your assumptions about the concrete aspects of the interaction being correct. +Therefore if you already put in the work to specify the correct aspects of such interaction, please consider contributing to this project so that user-event might cover these cases too. + ## Writing tests with `userEvent` We recommend invoking [`userEvent.setup()`](setup.mdx) before the component is From 145ef9439685da2e697a1e6bbd8b7c76319ba322 Mon Sep 17 00:00:00 2001 From: Philipp Fritsche Date: Sun, 10 Jul 2022 08:31:16 +0200 Subject: [PATCH 6/6] add missing backticks --- docs/user-event/intro.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-event/intro.mdx b/docs/user-event/intro.mdx index 8b73d9afd..d7666d09e 100644 --- a/docs/user-event/intro.mdx +++ b/docs/user-event/intro.mdx @@ -48,7 +48,7 @@ There are, however, some user interactions or aspects of these [that aren't yet In these cases you can use `fireEvent` to dispatch the concrete events that your software relies on. Note that this makes your component and/or test reliant upon your assumptions about the concrete aspects of the interaction being correct. -Therefore if you already put in the work to specify the correct aspects of such interaction, please consider contributing to this project so that user-event might cover these cases too. +Therefore if you already put in the work to specify the correct aspects of such interaction, please consider contributing to this project so that `user-event` might cover these cases too. ## Writing tests with `userEvent`