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: Implement prototype for test function #30457

Draft
wants to merge 6 commits into
base: next
Choose a base branch
from

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Feb 4, 2025

Closes #

What I did

Given this story:

const RestaurantPage = meta.story({});
RestaurantPage.test('foo', async ({ canvas }) => { ... })
RestaurantPage.test('bar', async ({ canvas }) => { ... })

The tests become:

describe("RestaurantPage", () => {
   test("render test", ...); // hooks + renders story + play fn + after each
   test("foo", ...); // hooks + renders story + play fn + 'foo' test fn + after each
   test("bar", ...);// hooks + renders story + play fn + 'bar' test fn + after each
});

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-storybook/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-30457-sha-ca5962ea. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-30457-sha-ca5962ea
Triggered by @yannbf
Repository storybookjs/storybook
Branch yann/test-fn-prototype-vitest
Commit ca5962ea
Datetime Thu Feb 6 09:47:37 UTC 2025 (1738835257)
Workflow run 13176053769

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=30457

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 78.3 MB 80.4 MB 2.1 MB 14.47 2.6%
initSize 78.3 MB 141 MB 63 MB 0.93 44.6%
diffSize 97 B 60.9 MB 60.9 MB 0.78 100%
buildSize 7.25 MB 7.28 MB 30.6 kB 3.33 0.4%
buildSbAddonsSize 1.87 MB 1.87 MB 252 B 2.02 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 1.78 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.95 MB 3.95 MB 252 B 1.98 0%
buildPreviewSize 3.3 MB 3.33 MB 30.4 kB 4.7 0.9%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 17.1s 7.4s -9s -667ms -1.56 🔰-129.4%
generateTime 23s 19s -3s -982ms -0.78 -20.9%
initTime 5s 13.3s 8.2s 0.22 62%
buildTime 9.8s 8.4s -1s -387ms -1.06 -16.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.1s 4.9s -196ms -0.4 -3.9%
devManagerResponsive 3.7s 3.7s -47ms -0.32 -1.3%
devManagerHeaderVisible 842ms 752ms -90ms -0.1 -12%
devManagerIndexVisible 880ms 776ms -104ms -0.12 -13.4%
devStoryVisibleUncached 2.9s 3.8s 819ms 0.2 21.5%
devStoryVisible 879ms 776ms -103ms -0.16 -13.3%
devAutodocsVisible 775ms 703ms -72ms -0.08 -10.2%
devMDXVisible 716ms 728ms 12ms 0.15 1.6%
buildManagerHeaderVisible 1.6s 687ms -1s -12ms -0.27 -147.3%
buildManagerIndexVisible 1.9s 702ms -1s -203ms -0.27 -171.4%
buildStoryVisible 1.5s 670ms -884ms -0.26 -131.9%
buildAutodocsVisible 6.8s 590ms -6s -254ms -0.24 -1060%
buildMDXVisible 1.1s 497ms -604ms -0.47 -121.5%

Copy link

nx-cloud bot commented Feb 4, 2025

View your CI Pipeline Execution ↗ for commit ca5962e.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 50s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-06 09:48:50 UTC

@yannbf yannbf force-pushed the yann/test-fn-prototype-vitest branch from e6b0c6d to ca5962e Compare February 6, 2025 09:42
Base automatically changed from kasper/csf-factories to next February 12, 2025 14:25
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.

1 participant