The documentation mentions re-using play functions for interactions testing like this:
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
// Runs the FirstStory and Second story play function before running this story's play function
await FirstStory.play({ canvasElement });
await SecondStory.play({ canvasElement });
await userEvent.type(canvas.getByTestId('another-element'), 'random value');
},
Although when I do exactly that, there is a TS error:
Argument of type '{ canvasElement: any; }' is not assignable to parameter of type 'PlayFunctionContext<ReactRenderer, {}>'.
Type '{ canvasElement: any; }' is missing the following properties from type 'StoryIdentifier': componentId, title, kind, id, and 3 more.ts(2345)
I tried passing ...rest but that did not help either (attached screengrabs for more info)