Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

1.2 KB
Raw Blame
import { getStorybookSdkAuthConfigForUser } from "embedding-sdk-bundle/test/CommonSdkStoryWrapper";
import { getHostedBundleStoryDecorator } from "embedding-sdk-package/test/getHostedBundleStoryDecorator";
import {
  MOCK_AD_HOC_QUESTION_ID,
  mockGeneratedCardChunk,
  mockStreamResponse,
} from "embedding-sdk-shared/test/mocks/mock-metabot-response";

import { MetabaseProvider } from "../MetabaseProvider";

import { MetabotQuestion } from "./MetabotQuestion";

const config = getStorybookSdkAuthConfigForUser("admin");

export default {
  title: "EmbeddingSDK/MetabotQuestion/public",
  parameters: {
    layout: "fullscreen",
    msw: {
      handlers: [
        mockStreamResponse([
          { type: "text-start", id: "t1" },
          {
            type: "text-delta",
            id: "t1",
            delta: `Here is the [question link](${MOCK_AD_HOC_QUESTION_ID})`,
          },
          { type: "text-end", id: "t1" },
          mockGeneratedCardChunk(),
          { type: "finish", finishReason: "stop" },
        ]),
      ],
    },
  },
  decorators: [getHostedBundleStoryDecorator()],
};
export const Default = () => (
  <MetabaseProvider authConfig={config}>
    <MetabotQuestion />
  </MetabaseProvider>
);