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

FIX ref getSourceType for paths with */index.html #10421

Merged
merged 6 commits into from
Apr 14, 2020

Conversation

goldhand
Copy link
Contributor

@goldhand goldhand commented Apr 14, 2020

Issue: #10324

What I did

  • Changes getSourceType to return 'local' if source matches location with index.html in pathname.
  • Added refs.test.js to test this edge case and other cases - I needed to mock different values with the global.location. Not too happy with the implementation but I don't know another way to change a mock module between tests.

How to test

* Fixes storybookjs#10324
* Visiting <storybook-path>/index.html?path=/story/* will return "local" in getSourceType and will not throw an exception by going to 'external' switch case block.
@goldhand
Copy link
Contributor Author

I'm not sure what the @netlify build check failures are about but trying to debug. I build locally just fine so I'm thinking its some CI task I haven't done...

@ndelangen ndelangen added this to the 6.0 milestone Apr 14, 2020
@ndelangen ndelangen self-assigned this Apr 14, 2020
@goldhand
Copy link
Contributor Author

Sorry, I should have checked the status of this first but I missed that you already approved this @ndelangen . I did a minor refactor of the test while I was trying to figure out why the netlify checks were failing.

@ndelangen
Copy link
Member

I'm on it

@ndelangen ndelangen merged commit 08a57a1 into storybookjs:next Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants