Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Add basic story
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgott committed Jul 17, 2024
1 parent 80f774a commit 6b930f6
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
stories: ["../components/**/*.stories.@(js|jsx|ts|tsx)"],
stories: [
"../components/**/*.stories.@(js|jsx|ts|tsx)",
"../layouts/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: ["@storybook/addon-interactions", "@storybook/addon-viewport"],
framework: {
name: "@storybook/nextjs",
Expand Down
68 changes: 68 additions & 0 deletions layouts/DocsPage/Navigation.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within } from "@storybook/testing-library";
import { expect } from "@storybook/jest";
import { default as DocNavigation } from "layouts/DocsPage/Navigation";

import { TabItem } from "./TabItem";
import { Tabs } from "./Tabs";

export const NavigationFourLevels = () => {
const data = [
{
icon: "wrench",
title: "Enroll Resources",
entries: [
{
title: "Machine ID",
slug: "/enroll-resources/machine-id/",
entries: [
{
title: "Deploy Machine ID",
slug: "/enroll-resources/machine-id/deployment/",
entries: [
{
title: "Deploy Machine ID on AWs",
slug: "/enroll-resources/machine-id/deployment/",
},
],
},
],
},
],
},
];

return (
<DocNavigation
data={data}
section={true}
currentVersion="16.x"
></DocNavigation>
);
};

const meta: Meta<typeof Tabs> = {
title: "layouts/DocNavigation",
component: NavigationFourLevels,
};
export default meta;
type Story = StoryObj<typeof Tabs>;

// export const InitialStateTab: Story = {
// play: async ({ canvasElement, step }) => {
// const canvas = within(canvasElement);
// await step("Should be the text for the selected option", async () => {
// expect(
// await canvas.findByText(
// "Instructions for installing release using shell commands."
// )
// ).toBeTruthy();
// });
// await step(
// "Selected option should be disabled for re-selection",
// async () => {
// expect(canvas.getByText("Shell")).toBeDisabled();
// }
// );
// },
// };

0 comments on commit 6b930f6

Please sign in to comment.