featureFeedback.stories.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {BrowserClient} from '@sentry/react';
  2. import {FeatureFeedback} from 'sentry/components/featureFeedback';
  3. import GlobalModal from 'sentry/components/globalModal';
  4. import IndicatorContainer from 'sentry/components/indicators';
  5. import {RouteContext} from 'sentry/views/routeContext';
  6. export default {
  7. title: 'Components/FeatureFeedback',
  8. };
  9. export const _FeatureFeedback = () => {
  10. const router = {
  11. location: {
  12. query: {},
  13. pathname: '/mock-pathname/',
  14. },
  15. routes: [],
  16. params: {orgId: 'org-slug'},
  17. };
  18. // A workaround for this story to not send feedback events to Sentry
  19. // TODO: Check if there is a way to mock this in Storybook
  20. BrowserClient.prototype.captureEvent = () => {};
  21. return (
  22. <RouteContext.Provider
  23. value={{
  24. router,
  25. location: router.location,
  26. params: {},
  27. routes: [],
  28. }}
  29. >
  30. <FeatureFeedback featureName="test" />
  31. <GlobalModal />
  32. <IndicatorContainer />
  33. </RouteContext.Provider>
  34. );
  35. };
  36. _FeatureFeedback.storyName = 'FeatureFeedback';
  37. _FeatureFeedback.parameters = {
  38. docs: {
  39. description: {
  40. story:
  41. 'It includes a button that, when clicked, opens a modal that the user can use to send feedback to sentry',
  42. },
  43. },
  44. };