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

Test: Add testing library and user event to the test package #24225

Merged
merged 15 commits into from
Sep 22, 2023

Conversation

kasperpeulen
Copy link
Contributor

@kasperpeulen kasperpeulen commented Sep 19, 2023

What I did

Added testing library and user event to the test package and fixed some bugs as not all methods were properly instrumented and the types were incorrect.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-24225-sha-d42b137f. Install it by pinning all your Storybook dependencies to that version.

More information
Published version 0.0.0-pr-24225-sha-d42b137f
Triggered by @kasperpeulen
Repository storybookjs/storybook
Branch kasper/testing-library
Commit d42b137f
Datetime Fri Sep 22 10:05:01 UTC 2023 (1695377101)
Workflow run 6272903355

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=24225

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6232425832

@socket-security
Copy link

socket-security bot commented Sep 19, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
nextra 1.1.0 shell, environment +0 77.3 kB quietshu
@types/chai 4.3.5 None +0 77.2 kB types

@socket-security
Copy link

socket-security bot commented Sep 19, 2023

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Shell access nextra 1.1.0

Next steps

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6232522117

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6233559366

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6233733363

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6233733496

@yannbf yannbf changed the title Test: Add testing library and user event to the test pacakge Test: Add testing library and user event to the test package Sep 19, 2023
@kasperpeulen kasperpeulen changed the base branch from kasper/test-package to next September 19, 2023 10:11
@kasperpeulen kasperpeulen changed the base branch from next to kasper/test-package September 19, 2023 10:31
@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6248968571

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6250438879

@ndelangen ndelangen marked this pull request as draft September 21, 2023 12:54

channel.on(FORCE_REMOUNT, () => spy.spies.forEach((mock) => mock.mockClear()));
channel.on(STORY_RENDER_PHASE_CHANGED, ({ newPhase }) => {
if (newPhase === 'loading') spy.spies.forEach((mock) => mock.mockClear());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to clear the mock on the 'completed' phase too?

@yannbf
Copy link
Member

yannbf commented Sep 22, 2023

I just tested the new canary out in Mealdrop on the feat/storybook-test-package branch (it's updated, in case you want to try yourself)

and when visiting a story with the play function, the browser completely hangs/crashes. I'm assuming it might have to do with a recursion

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @kasperpeulen. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/6272876785

@kasperpeulen kasperpeulen marked this pull request as ready for review September 22, 2023 14:47
@kasperpeulen kasperpeulen merged commit 5ace11e into kasper/test-package Sep 22, 2023
@kasperpeulen kasperpeulen deleted the kasper/testing-library branch September 22, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants