Skip to content

Commit

Permalink
test: remove legacy chromatic mode and use desktop as default
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Dec 10, 2024
1 parent f3076ca commit 03e1bc2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
12 changes: 1 addition & 11 deletions apps/nextjs/.storybook/chromatic.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import "@storybook/csf";

type ChromaticModes =
| "legacy"
| "mobile"
| "mobile-wide"
| "desktop"
| "desktop-wide";
type ChromaticModes = "mobile" | "mobile-wide" | "desktop" | "desktop-wide";

export function chromaticParams(modes: ChromaticModes[]) {
return {
Expand All @@ -23,11 +18,6 @@ export function chromaticParams(modes: ChromaticModes[]) {
...(modes.includes("desktop-wide") && {
"desktop-wide": { viewport: "desktopWide" },
}),
// NOTE: Before we used modes, all snapshots were by default in the 1200px mode.
// This option allows us to reuse the existing desktop snapshot until we're ready to migrate
...(modes.includes("legacy") && {
"1200px": { viewport: 1200 as const },
}),
},
},
};
Expand Down
2 changes: 2 additions & 0 deletions apps/nextjs/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { DialogProvider } from "../src/components/AppComponents/DialogContext";
import { AnalyticsProvider } from "../src/mocks/analytics/provider";
import { ClerkDecorator } from "../src/mocks/clerk/ClerkDecorator";
import { TRPCReactProvider } from "../src/utils/trpc";
import { chromaticParams } from "./chromatic";
import { RadixThemeDecorator } from "./decorators/RadixThemeDecorator";
import "./preview.css";

Expand Down Expand Up @@ -48,6 +49,7 @@ const preview: Preview = {
},
},
},
...chromaticParams(["desktop"]),
},
loaders: [mswLoader],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { ChatContextProps } from "@/components/ContextProviders/ChatProvide
import { ChatContext } from "@/components/ContextProviders/ChatProvider";
import { DemoContext } from "@/components/ContextProviders/Demo";

import { chromaticParams } from "../../../../../.storybook/chromatic";
import ExportButtons from "./";

const ChatDecorator: Story["decorators"] = (Story, { parameters }) => (
Expand Down Expand Up @@ -43,9 +42,6 @@ const meta: Meta<typeof ExportButtons> = {
sectionRefs: {},
documentContainerRef: { current: null },
},
parameters: {
...chromaticParams(["legacy"]),
},
};

export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const meta: Meta<typeof Header> = {
decorators: [DemoDecorator],
parameters: {
layout: "fullscreen",
...chromaticParams(["legacy"]),
docs: {
story: {
height: "150px",
Expand All @@ -48,7 +47,7 @@ export const DemoUser: Story = {
appSessionsPerMonth: 3,
appSessionsRemaining: 2,
},
...chromaticParams(["legacy", "desktop-wide"]),
...chromaticParams(["desktop", "desktop-wide"]),
},
};

Expand Down

0 comments on commit 03e1bc2

Please sign in to comment.