Skip to content
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

[Bug]: Type of canvasElement from getStoryContext is unknown #436

Open
unional opened this issue Mar 5, 2024 · 1 comment
Open

[Bug]: Type of canvasElement from getStoryContext is unknown #436

unional opened this issue Mar 5, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@unional
Copy link

unional commented Mar 5, 2024

Describe the bug

import { getStoryContext } from "@storybook/test-runner"

// in postVisit
const storyContext = await getStoryContext(page, context)
storyContext.canvasElement // type unknown should be HTMLElement

This is caused by:

interfact StoryContext<TRenderer extends Renderer = Renderer, ...> ... {

  canvasElement: TRenderer['canvasElement']
}

type Renderer = {
  canvasElement: unknown
}

To Reproduce

No response

System

Not applicable

Additional context

No response

@unional unional added bug Something isn't working needs triage labels Mar 5, 2024
@unional
Copy link
Author

unional commented Mar 5, 2024

Note that in both preVisit and postVisit the value of canvasElement is undefined at runtime.
Not sure if that is intentional or it's a bug. In either way the type and runtime doesn't match.

@valentinpalkovic valentinpalkovic transferred this issue from storybookjs/storybook Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant