sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.28k forks source link

Add mocks for the storybook stories — async validation of insights creation UI #21907

Open vovakulikov opened 3 years ago

vovakulikov commented 3 years ago

Now stories, where we use async validation, have no mocks system for fetch methods. As a result, we always have a weird error message in the storybook stories.

Tech details: Put fetch methods to our InsightAPI context to be able to mock them in storybooks stories and tests.

Some helpers could be reused from this part of code insight code-base (related comment https://github.com/sourcegraph/sourcegraph/pull/23777#discussion_r688380271)

github-actions[bot] commented 3 years ago

Heads up @joelkw @felixfbecker - the "team/code-insights" label was applied to this issue.