Skip to content

chore: add a story for WorkspaceOutdatedTooltip #11695

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

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import { MockTemplateVersion, MockTemplate } from "testHelpers/entities";
import { WorkspaceOutdatedTooltip } from "./WorkspaceOutdatedTooltip";

const meta: Meta<typeof WorkspaceOutdatedTooltip> = {
title: "components/WorkspaceOutdatedTooltip",
component: WorkspaceOutdatedTooltip,
parameters: {
queries: [
{
key: ["templateVersion", MockTemplateVersion.id],
data: MockTemplateVersion,
},
],
},
args: {
onUpdateVersion: action("onUpdateVersion"),
templateName: MockTemplate.display_name,
latestVersionId: MockTemplateVersion.id,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding a new decorator you can use parameters like:

parameters: {
  queries: [
    {
      key: ["templateVersion", MockTemplateVersion.id],
      data: MockTemplateVersion 
    }
  ]
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! neat! the health page example I looked at used useQueryClient, but this seems nice

};

export default meta;
type Story = StoryObj<typeof WorkspaceOutdatedTooltip>;

const Example: Story = {};

export { Example as WorkspaceOutdatedTooltip };
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const Language = {

interface TooltipProps {
onUpdateVersion: () => void;
latestVersionId: string;
templateName: string;
latestVersionId: string;
ariaLabel?: string;
}

Expand Down