Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can’t find expect() documentation in the API doc page #5206

Closed
binki opened this issue Jan 2, 2018 · 13 comments
Closed

I can’t find expect() documentation in the API doc page #5206

binki opened this issue Jan 2, 2018 · 13 comments

Comments

@binki
Copy link

binki commented Jan 2, 2018

Do you want to request a feature or report a bug?
doc bug

What is the current behavior?

Searching for a link to “expect(” (e.g., type the apostrophe character and then expect( in a Mozilla-based browser) fails on https://facebook.github.io/jest/docs/en/api.html

What is the expected behavior?

Searching for a link to “expect(” finds a hyperlink to in-page documentation or blurb linking to the documentation for expect(). I expect to have the same experience when searching for hyperlinks containing with expect( as I do when searching for, e.g., the hyperlinks containing afterAll(.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

n/a

@SimenB
Copy link
Member

SimenB commented Jan 2, 2018

@ericnakagawa this is a docusaurus thing, right?

@SimenB
Copy link
Member

SimenB commented Jan 3, 2018

@binki Could you open up an issue at docusaurus for this?

/cc @JoelMarcey

@binki
Copy link
Author

binki commented Jan 3, 2018

@SimenB docusaurus appears to be a website generator which is not specific to jest. For the issue to be in docusaurus, that must mean that jest’s website stuff is set up so that expect() documentation should appear on the generated website.

Jest has configured docusaurus in https://github.com/facebook/jest/blob/96a44df8c07742997d7068c7b5925d1394fae0f9/website/siteConfig.js to show the document with id of api as the “API” header. This document is https://github.com/facebook/jest/blob/23b7e98aefa06321f776f7e883532653d1a7bf41/docs/GlobalAPI.md . So I believe the issue is that the jest project is not putting all of the documentation into GlobalAPI.md rather than the issue being somehow with docusaurus.

@binki
Copy link
Author

binki commented Jan 3, 2018

After investigating out docusaurus works, I noticed that it supports defining a sidebar and that docs links are automatically added into the sidebar. However, when I visit the site, I see this:

image

I noticed that if I click that little “go to fullscreen” button, it shows the sidebar:

image

If the sidebar were not hidden when I visited the page, then the “Expect” link in the sidebar would be visible to my in-page hyperlink search. However, it isn’t by default and I find it very confusing.

Now that I think I better understand the issue and have made it clear why I couldn’t find the docs for expect, is this a docusaurus issue or a jest one? Maybe jest is specifying a style which hides the sidebar by default instead of putting it at the end of the page and it could just specify a better style. Or maybe this is stock docusaurus style. Please let me know.

@binki
Copy link
Author

binki commented Jan 3, 2018

I’m suspecting that the issue is jest-specific configuration because when I visit docusauru’s own site, I always see the sidebar: https://docusaurus.io/docs/en/site-config.html :

image

So I bet the issue is in jest’s configuration of docusaurus rather than docusaurus itself.

@SimenB
Copy link
Member

SimenB commented Jan 3, 2018

Hmm, you seem to be getting the mobile version. To clarify, are you using ctrl+f to search, or the search built in to the website?

image

@binki
Copy link
Author

binki commented Jan 4, 2018

As I described, I'm using ' to search: https://support.mozilla.org/en-US/kb/search-contents-current-page-text-or-links#w_search-links-only

If jest just allowed docusaurus to display the sidebar as expanded like in docusaurus's own docs or put it after the content for mobile view, then searching the page for expect as a hyperlink would work. Additionally, if the sidebar expansion button in mobile mode were made more obvious instead of using the universal “switch to full screen” symbol, maybe I would have tried expanding it. But I didn't even know that there was supposed to be a sidebar until reading docusaurus's docs…

I'm using desktop with my browser slotted to the right half of my screen. A lot of websites do not support this configuration and force me to scroll like 100px to see buttons on the upper right of the page because they have a fixed minimum width which is slightly too big. E.g., Facebook does this and forces me to scroll to see my notifications: https://i.imgur.com/iN2AWzF.png . Other websites, like your docs site, seem to use this width to detect opening the page in an iPad (I'm using desktop) and switch to an entirely new layout instead of being responsive.

@SimenB
Copy link
Member

SimenB commented Jan 4, 2018

We are on a somewhat old version of docusaurs (a beta version), might be resolved whenever we are able to deploy with the latest version, see #5229 for latest

@SimenB
Copy link
Member

SimenB commented Jan 4, 2018

@binki a new version of the website is now deployed, could you please test again? I cannot reproduce your issue now (but I was not by a computer earlier today, so I was unable to test before the successful deploy)

@binki
Copy link
Author

binki commented Jan 4, 2018

@SimenB Thanks! The new version of the website includes the sidebar for me just like docusaurus’s own website, enabling me to find the “Expect” page:

image

I’d consider that fixing the issue for me.

@JoelMarcey
Copy link
Contributor

The expect() docs are here: https://facebook.github.io/jest/docs/en/expect.html

@SimenB
Copy link
Member

SimenB commented Jan 4, 2018

Got fixed somewhere between beta 3 and 1.0.3 of docusaurus then. Great!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants