mirror of https://github.com/coder/coder.git
38 lines
945 B
TypeScript
38 lines
945 B
TypeScript
import { chromatic } from "testHelpers/chromatic";
|
|
import {
|
|
mockApiError,
|
|
MockTemplateExample,
|
|
MockTemplateExample2,
|
|
} from "testHelpers/entities";
|
|
import { getTemplatesByTag } from "utils/starterTemplates";
|
|
import { StarterTemplatesPageView } from "./StarterTemplatesPageView";
|
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
|
|
const meta: Meta<typeof StarterTemplatesPageView> = {
|
|
title: "pages/StarterTemplatesPage",
|
|
parameters: { chromatic },
|
|
component: StarterTemplatesPageView,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof StarterTemplatesPageView>;
|
|
|
|
export const Example: Story = {
|
|
args: {
|
|
error: undefined,
|
|
starterTemplatesByTag: getTemplatesByTag([
|
|
MockTemplateExample,
|
|
MockTemplateExample2,
|
|
]),
|
|
},
|
|
};
|
|
|
|
export const Error: Story = {
|
|
args: {
|
|
error: mockApiError({
|
|
message: "Error on loading the template examples",
|
|
}),
|
|
starterTemplatesByTag: undefined,
|
|
},
|
|
};
|