new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Storybook · all subjects

play functions & testing

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

storybook/test package for play functions

Storybook provides an instrumented version of testing library in the storybook/test core package (formerly @storybook/testing-library). When writing interactions and play functions, use helper functions from storybook/test so that addon-interactions can intercept them and allow stepping through during debugging.

Correct import for testing library in play functions

Import testing library functions from 'storybook/test' rather than directly from '@testing-library/react' or other testing-library packages. The legacy import from '@storybook/testing-library' is also accepted but storybook/test is preferred.

Example: correct play function using storybook/test

import { within } from 'storybook/test'; Default.play = async (context) => { const canvas = within(context.canvasElement); };

Incorrect import for play functions

Do not import testing library functions from '@testing-library/react' or other testing-library packages directly when writing play functions. Imports from these packages will not be intercepted by addon-interactions.

Give your agent this brain