-
Notifications
You must be signed in to change notification settings - Fork 3
wrap interactor's actions to show them in storybook interactions debugger #126
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
Conversation
|
|
✔️ Deploy Preview for interactors canceled. 🔨 Explore the source changes: 4a0ae0f 🔍 Inspect the deploy log: https://app.netlify.com/sites/interactors/deploys/61aefbbe98d7200007df999b |
|
Dropping this here to track changes to storybook required to implement this storybookjs/storybook#16667 |
packages/globals/src/globals.ts
Outdated
| wrapper: ( | ||
| description: string, | ||
| action: () => Promise<T>, | ||
| type: ActionType, | ||
| options: InteractorOptions | ||
| ) => () => Promise<T> | ||
| ): () => boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this wrapper should be a type:
export interface InteractionEvent<T> {
description: string;
action: () => Promise<T> ;
type: ActionType;
options: InteractionOptions;
}
export type InteractionHook<T> = (event: InteractionEvent<T>) => Promise<T>;
export function addActionWrapper<T>(hook: InteractionHook<T>): () => boolean {
// add it
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. That was a little bit tricky to not break things
Motivation
Storybook announced new feature interactive stories.
Approach
This spike shows how we can use that feature with our interactors.
trackmethod isn't exported for public usage.