Skip to content
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

All variants snapshots are not consistent #10

Open
noranda opened this issue Jan 29, 2024 · 0 comments
Open

All variants snapshots are not consistent #10

noranda opened this issue Jan 29, 2024 · 0 comments

Comments

@noranda
Copy link

noranda commented Jan 29, 2024

Hi!

I'm using this addon to have a single Snapshot story for use in Chromatic, as suggested. This works great and saves me a ton of time manually adding these. The problem is that the order of each variant doesn't appear to be consistent, causing "changes" in my Chromatic visual tests that aren't really changes. Is this a bug? Or is there something I can do to make sure the order remains consistent? TY!

// Snapshot.stories.tsx

import {type Meta, type StoryObj} from '@storybook/react';

import {Button} from '~/components';
import DefaultMeta, {Default} from './Default.stories';

const meta = {
  argTypes: DefaultMeta.argTypes,
  component: Button,
  title: 'Components/Button',
} satisfies Meta<typeof Button>;

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

export const Snapshot = {
  ...Default,
  parameters: {
    ...Default.parameters,
    chromatic: {
      chromatic: {disableSnapshot: false},
      pauseAnimationAtEnd: true,
    },
    variants: {enable: true},
  },
} satisfies Story;
Screenshot 2024-01-29 at 2 36 31 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant