play function

A function on a Storybook story that runs after it renders, simulating user actions and asserting on the result.

In more detail

A play function might click a button with userEvent and check that a callback fired. Storybook's test runner runs every play function as an interaction test.

Related terms

Taught in

References