diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index baec48071eda..bfd6341e7850 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,24 @@ +## 8.5.0-alpha.20 + +- Addon Test: Add `@vitest/coverage-v8` during postinstall if no coverage reporter is installed - [#29993](https://github.com/storybookjs/storybook/pull/29993), thanks @ghengeveld! +- Addon Test: Add support for previewHead - [#29808](https://github.com/storybookjs/storybook/pull/29808), thanks @ndelangen! +- Addon Test: Always run Vitest in watch mode internally - [#29749](https://github.com/storybookjs/storybook/pull/29749), thanks @JReinhold! +- Addon Test: Filter out falsy test results in TestProviderRender - [#30001](https://github.com/storybookjs/storybook/pull/30001), thanks @valentinpalkovic! +- Addon Test: Handle undefined storyId - [#29998](https://github.com/storybookjs/storybook/pull/29998), thanks @ghengeveld! +- Addon Test: Make component tests status row link to the story's tests panel - [#29992](https://github.com/storybookjs/storybook/pull/29992), thanks @ghengeveld! +- Addon Test: Merge viteFinal config into vitest config - [#29806](https://github.com/storybookjs/storybook/pull/29806), thanks @ndelangen! +- Addon Test: Prompt switch to `experimental-nextjs-vite` - [#29814](https://github.com/storybookjs/storybook/pull/29814), thanks @ndelangen! +- Addon Test: Use ProgressSpinner for stop button in Testing Module - [#29997](https://github.com/storybookjs/storybook/pull/29997), thanks @ghengeveld! + +## 8.5.0-alpha.19 + +- Addon A11y: Create a11y test provider and revamp a11y addon - [#29643](https://github.com/storybookjs/storybook/pull/29643), thanks @valentinpalkovic! +- Addon Test: Fix indexing behavior - [#29836](https://github.com/storybookjs/storybook/pull/29836), thanks @yannbf! +- Addon Test: Fix run request while booting or restarting Vitest - [#29829](https://github.com/storybookjs/storybook/pull/29829), thanks @ghengeveld! +- Addon Test: Serve `staticDirs` with Vitest - [#29811](https://github.com/storybookjs/storybook/pull/29811), thanks @ghengeveld! +- RNW-Vite: Add tsconfig path aliases support - [#29953](https://github.com/storybookjs/storybook/pull/29953), thanks @shilman! +- RNW-Vite: Fix flow plugin including too many things - [#29952](https://github.com/storybookjs/storybook/pull/29952), thanks @dannyhw! + ## 8.5.0-alpha.18 - Addon Test: Clarify message when `vitest` detects missing deps - [#29763](https://github.com/storybookjs/storybook/pull/29763), thanks @ndelangen! diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index a23849bc7ae1..01b3195d2e17 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index efb51f302fc5..45fc3815ec5f 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 2bfa78900bc6..ef24a496f8b3 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 255546cd3bd6..0162f7ed1c0c 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index f5834a822026..2cb49f00af6e 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 4f7ad700ec0d..bb428b318872 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 277e1663e385..95bd0aa7e641 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index dc5588ee1d30..00c3280e990a 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 801c627195a0..3891ce1ce740 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 42f5f52b88aa..158008a17bae 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index c49cd1263543..9acb23a278cc 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "storybook-addons", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index dfebd2ef6b2d..12e162262346 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 0fc9ef53a4ef..6992d234f2e6 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 05786228223d..b28d642cffa9 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 104218a0957c..f5e0067ff5fd 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/test/package.json b/code/addons/test/package.json index 06213e0bf703..35a4077926e1 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-addon-test", - "version": "8.5.0-alpha.18", + "version": "8.5.0-alpha.20", "description": "Integrate Vitest with Storybook", "keywords": [ "storybook-addons", @@ -85,7 +85,6 @@ "@storybook/icons": "^1.2.12", "@storybook/instrumenter": "workspace:*", "@storybook/test": "workspace:*", - "@storybook/theming": "workspace:*", "polished": "^4.2.2", "prompts": "^2.4.0", "ts-dedent": "^2.2.0" @@ -113,6 +112,7 @@ "slash": "^5.0.0", "strip-ansi": "^7.1.0", "tinyglobby": "^0.2.10", + "tree-kill": "^1.2.2", "ts-dedent": "^2.2.0", "typescript": "^5.3.2", "vitest": "^2.1.3" diff --git a/code/addons/test/src/components/TestProviderRender.tsx b/code/addons/test/src/components/TestProviderRender.tsx index 35c7eb4b8a9e..017ecc2cf27f 100644 --- a/code/addons/test/src/components/TestProviderRender.tsx +++ b/code/addons/test/src/components/TestProviderRender.tsx @@ -1,6 +1,6 @@ import React, { type ComponentProps, type FC, useCallback, useMemo, useRef, useState } from 'react'; -import { Button, ListItem } from 'storybook/internal/components'; +import { Button, ListItem, ProgressSpinner } from 'storybook/internal/components'; import { TESTING_MODULE_CONFIG_CHANGE, type TestProviderConfig, @@ -17,15 +17,17 @@ import { PlayHollowIcon, PointerHandIcon, ShieldIcon, - StopAltHollowIcon, + StopAltIcon, } from '@storybook/icons'; import { isEqual } from 'es-toolkit'; import { debounce } from 'es-toolkit/compat'; -// Relatively importing from a11y to get the ADDON_ID -import { ADDON_ID as A11Y_ADDON_ID } from '../../../a11y/src/constants'; -import { type Config, type Details } from '../constants'; +import { + ADDON_ID as A11Y_ADDON_ID, + PANEL_ID as A11y_ADDON_PANEL_ID, +} from '../../../a11y/src/constants'; +import { type Config, type Details, PANEL_ID } from '../constants'; import { type TestStatus } from '../node/reporter'; import { Description } from './Description'; import { TestStatusIcon } from './TestStatusIcon'; @@ -66,6 +68,14 @@ const Checkbox = styled.input({ }, }); +const Progress = styled(ProgressSpinner)({ + margin: 2, +}); + +const StopIcon = styled(StopAltIcon)({ + width: 10, +}); + const statusOrder: TestStatus[] = ['failed', 'warning', 'pending', 'passed', 'skipped']; const statusMap: Record['status']> = { failed: 'negative', @@ -101,7 +111,8 @@ export const TestProviderRender: FC< return state.details?.testResults?.flatMap((result) => result.results - .filter((it) => !entryId || it.storyId === entryId || it.storyId.startsWith(`${entryId}-`)) + .filter(Boolean) + .filter((r) => !entryId || r.storyId === entryId || r.storyId?.startsWith(`${entryId}-`)) .map((r) => r.reports.find((report) => report.type === 'a11y')) ); }, [isA11yAddon, state.details?.testResults, entryId]); @@ -145,6 +156,12 @@ export const TestProviderRender: FC< const status = (state.failed ? 'failed' : results[0]?.status) || 'unknown'; + const openPanel = (id: string, panelId: string) => { + api.selectStory(id); + api.setSelectedPanel(panelId); + api.togglePanel(true); + }; + return ( @@ -182,11 +199,13 @@ export const TestProviderRender: FC< ) : ( ) : (