react-hooks-testing-library icon indicating copy to clipboard operation
react-hooks-testing-library copied to clipboard

Add docs to testing-library-docs

Open mpeyper opened this issue 6 years ago • 17 comments

There is an existing PR created to add docs to testing-library-docs from when testHook was part of react-testing-library. Since it was removed and the code merged with this library, the PR has stalled waiting on updates to change it to reference this library instead.

If anyone wants to take over the PR and update it accordingly, you are more than welcome. You can even add yourself as a contributor here for your effort too.

See the PR for more details.

Disclaimer: I am not affiliated with the testing-library-docs repo or the PR in question, but I was asked to take it over and just find myself a bit time poor to actually do so at the moment.

mpeyper avatar Mar 19 '19 12:03 mpeyper

@mpeyper could you point me out exactly what needs to be done? I might be interested to do it.

ab18556 avatar Mar 20 '19 11:03 ab18556

Hey guys, thanks for your lib, it looks promising. But it will be interesting if you can provide more examples in the doc. Especially on the rerender part, which is not very clear for me at this point.

DavidBabel avatar Mar 20 '19 23:03 DavidBabel

@ab18556 It was suggested that it would be useful to add some documentation in the ecosystem section of https://testing-library.com/docs/intro.

Some work was previously done when the API was part of react-testing-library, but it would need to be updated to reference react-hooks-testing-library instead of react-testing-library and moved into the other section now.

The API is also slightly different now to when the PR was created the main differences from the top of my head:

  • testHook -> renderHook
  • initialProps and rerender(newProps)
  • waitForNextUpdate()

It probably doesn't need to be too over the top with information, just the basics and a link back to our own docs (which also need to be improved).

mpeyper avatar Mar 21 '19 02:03 mpeyper

Ok I will give it a try tomorrow night

ab18556 avatar Mar 22 '19 01:03 ab18556

Great! I've also raised #19 now which is also around docs (but our own) if your keen for that as well?

mpeyper avatar Mar 22 '19 03:03 mpeyper

Sorry, I won't be able to update the doc. I am short on time and since english is my secondary language, I don't think I would be the best person to do it.

About the current issue, I made this PR https://github.com/alexkrolick/testing-library-docs/pull/64

It is based on the current doc's example. It might have to be updated once the doc is updated.

ab18556 avatar Mar 22 '19 22:03 ab18556

Thanks for the PR @ab18556, it's a good start. I think at least establishing an ecosystem page like this one would be enough to merge: https://github.com/alexkrolick/testing-library-docs/blob/master/docs/ecosystem-user-event.md

alexkrolick avatar Mar 23 '19 01:03 alexkrolick

@alexkrolick this is basically what I put into the example page. Maybe it shouldn't be in the example section?

ab18556 avatar Mar 23 '19 03:03 ab18556

Ok, moving it all into the ecosystem page sounds good, too.

alexkrolick avatar Mar 23 '19 04:03 alexkrolick

@mpeyper Any thoughts?

ab18556 avatar Mar 25 '19 05:03 ab18556

Sorry @ab18556 for not giving my thoughts (this one went under my radar).

I'm going to close this as since #40, we are no longer using react-testing-library for our rendering, so I'm no sure it's appropriate for us to be included in their docs anymore, unless there was some disclaimer added about this.

mpeyper avatar Apr 26 '19 20:04 mpeyper

It definitely fits in the ecosystem section, other things like native-testing-library or jest-dom don't depend on any core libs either

alexkrolick avatar Apr 26 '19 20:04 alexkrolick

I did not realise there was already precedence for this, so I'm happy to reopen this.

mpeyper avatar Apr 27 '19 11:04 mpeyper

@mpeyper What all needs done to finish this issue? I got some time on my hands and would love to wrap this issue up if possible.

LeviButcher avatar Jun 26 '20 00:06 LeviButcher

@LeviButcher there was (still is) as desire to get some representation in the official Testing Library docs. The original efforts by @ab18556 were made where we were using react-testing-library for rendering and fit more neatly into the regular mix of libraries. There were some suggestions that it could still make sense in the Ecosystem section, but I'm not sure what the stance is on that these days (i.e. is the use of dom-testing-library a prerequisite for getting in the main docs).

From my perspective, I feel like many of the testing libraries get to lean on the dom-testing-library docs for a lot of things (e.g. queries, async utils, etc.), whereas our implementation is a bit different so I would like to still maintain our own docs and have the a fairly basic example in the Testing Library docs and a link to our docs. Part of me feels like that's a duplication of effort though, so maybe we're best to look at moving what we have to the shared docs 🤷‍♂️

I'm open to suggestions on how best to do it.

mpeyper avatar Jun 26 '20 07:06 mpeyper

@LeviButcher I am available to work with you on this as well, If thats fine.

theresasogunle avatar Jul 02 '20 14:07 theresasogunle

@theresasogunle Absolutely!

I definitely agree with adding it to the ecosystem section in the Testing Library docs and based on past pull requests that seems to be what everyone agreed to.

I think we should copy the first examples on this page of the react hooks docs and put it in a hook testing library ecosystem page with a link back to the react hooks testing library docs.

I think this is a perfect first time contributor pull request and I noticed you haven't contributed to this one yet. So I was wondering if you would like to take the lead on contributing this to the testing-library-docs.

LeviButcher avatar Jul 06 '20 00:07 LeviButcher