From 44a6a83cc9b74c0699add02a71cf1d4edcb833bf Mon Sep 17 00:00:00 2001 From: Nabeel Valley <36758308+nabeelvalley@users.noreply.github.com> Date: Thu, 9 Jul 2020 14:27:09 +0200 Subject: [PATCH 1/2] Add __BASE_PATH__ definition to storybook config --- docs/docs/visual-testing-with-storybook.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/docs/visual-testing-with-storybook.md b/docs/docs/visual-testing-with-storybook.md index d7cb3214cf28e..ac685ee339f9a 100644 --- a/docs/docs/visual-testing-with-storybook.md +++ b/docs/docs/visual-testing-with-storybook.md @@ -115,8 +115,9 @@ global.___loader = { hovering: () => {}, } -// __PATH_PREFIX__ is used inside gatsby-link an other various places. For storybook not to crash, you need to set it as well. +// __PATH_PREFIX__ and __BASE_PATH__ are used inside gatsby-link an other various places. For storybook not to crash, you need to set it as well. global.__PATH_PREFIX__ = "" +global.__BASE_PATH__ = "" // Navigating through a gatsby app using gatsby-link or any other gatsby component will use the `___navigate` method. // In Storybook it makes more sense to log an action than doing an actual navigate. Checkout the actions addon docs for more info: https://github.com/storybookjs/storybook/tree/master/addons/actions. From fd10c2ec3ce74a8eb6d023084de3d83d8daca9ea Mon Sep 17 00:00:00 2001 From: Nabeel Valley <36758308+nabeelvalley@users.noreply.github.com> Date: Fri, 17 Jul 2020 10:13:15 +0200 Subject: [PATCH 2/2] Globals need not be defined for Storybook Docs Update to Docs: Removes the need to declare the `__BASE_PATH__` and `__PATH_PREFIX__` in the Storybook config for Tests to work --- docs/docs/visual-testing-with-storybook.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/docs/visual-testing-with-storybook.md b/docs/docs/visual-testing-with-storybook.md index ac685ee339f9a..f7c898b5e904d 100644 --- a/docs/docs/visual-testing-with-storybook.md +++ b/docs/docs/visual-testing-with-storybook.md @@ -115,10 +115,6 @@ global.___loader = { hovering: () => {}, } -// __PATH_PREFIX__ and __BASE_PATH__ are used inside gatsby-link an other various places. For storybook not to crash, you need to set it as well. -global.__PATH_PREFIX__ = "" -global.__BASE_PATH__ = "" - // Navigating through a gatsby app using gatsby-link or any other gatsby component will use the `___navigate` method. // In Storybook it makes more sense to log an action than doing an actual navigate. Checkout the actions addon docs for more info: https://github.com/storybookjs/storybook/tree/master/addons/actions.