mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 05:11:49 +08:00
Add highlight annotations to csf4.ts and update e2e tests for a11y panel visibility
This commit is contained in:
parent
9bacc23477
commit
098ae3e15c
@ -11,6 +11,7 @@ import type { NormalizedProjectAnnotations } from 'storybook/internal/types';
|
||||
|
||||
import actionAnnotations from 'storybook/actions/preview';
|
||||
import backgroundsAnnotations from 'storybook/backgrounds/preview';
|
||||
import highlightAnnotations from 'storybook/highlight/preview';
|
||||
import measureAnnotations from 'storybook/measure/preview';
|
||||
import outlineAnnotations from 'storybook/outline/preview';
|
||||
import { composeConfigs, normalizeProjectAnnotations } from 'storybook/preview-api';
|
||||
@ -38,6 +39,9 @@ export function __definePreview<TRenderer extends Renderer>(
|
||||
(viewportAnnotations.default ?? viewportAnnotations)(),
|
||||
// @ts-expect-error CJS fallback
|
||||
(backgroundsAnnotations.default ?? backgroundsAnnotations)(),
|
||||
// @ts-expect-error CJS fallback
|
||||
(highlightAnnotations.default ?? highlightAnnotations)(),
|
||||
|
||||
// @ts-expect-error CJS fallback
|
||||
(measureAnnotations.default ?? measureAnnotations)(),
|
||||
// @ts-expect-error CJS fallback
|
||||
|
@ -237,7 +237,7 @@ test.describe('Manager UI', () => {
|
||||
|
||||
// panel is closed
|
||||
await expect(mobileNavigationHeading).toHaveText('Example/Button/Secondary');
|
||||
await expect(sbPage.page.locator('#tabbutton-addon-controls')).toBeHidden();
|
||||
await expect(sbPage.page.locator('#list-item-storybook/a11y/panel')).toBeHidden();
|
||||
|
||||
// open panel
|
||||
await sbPage.page.locator('[title="Open addon panel"]').click();
|
||||
@ -247,14 +247,14 @@ test.describe('Manager UI', () => {
|
||||
await addonsMenuButton.click();
|
||||
|
||||
// panel is open
|
||||
await expect(sbPage.page.locator('#list-item-addon-controls')).toBeVisible();
|
||||
await expect(sbPage.page.locator('#list-item-storybook/a11y/panel')).toBeVisible();
|
||||
|
||||
// close panel
|
||||
await sbPage.page.locator('[title="Close addon panel"]').click();
|
||||
|
||||
// panel is closed
|
||||
await expect(mobileNavigationHeading).toHaveText('Example/Button/Secondary');
|
||||
await expect(sbPage.page.locator('#tabbutton-addon-controls')).toBeHidden();
|
||||
await expect(sbPage.page.locator('#list-item-storybook/a11y/panel')).toBeHidden();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user