storycap icon indicating copy to clipboard operation
storycap copied to clipboard

Is there a way of changing args for screenshots?

Open Poimen opened this issue 3 years ago • 0 comments

We have a number of stories defined that only contain a single story, but each have a number of args that the users can change to see the components in actions.

For instance:

export const TextField = TextFieldTemplate.bind({});
TextField.args = {
  fieldLabel: 'Field Label',
  placeholder: 'Example Placeholder Hint',
  hintText: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti voluptatum pariatur, rem veniam sed quam tempora natus odio sapiente facilis quaerat, totam, dolorem a fugiat unde maxime illum quos praesentium.',
  disabled: false,
  value: '',
  error: false
};

We would like to test the disabled and error states without having to create separate stories (i.e. we want a single story for the user to see, but take screenshots of 3 states of the booleans).

I didn't see anything in the docs where this is done.

Can storycap do this style of testing?

Poimen avatar Jun 20 '22 13:06 Poimen