Skip to content

Commit

Permalink
Merge branch 'determine-total-test-count' into norbert/testmodule-opt…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
ndelangen authored Nov 22, 2024
2 parents 29f1b77 + 732d277 commit f603ffb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions code/addons/test/src/components/ContextMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
useState,
} from 'react';

import { Button, type ListItem } from 'storybook/internal/components';
import { Button, ListItem } from 'storybook/internal/components';
import { useStorybookApi } from 'storybook/internal/manager-api';
import { useTheme } from 'storybook/internal/theming';
import { type API_HashEntry, type Addon_TestProviderState } from 'storybook/internal/types';
Expand All @@ -23,8 +23,7 @@ export const ContextMenuItem: FC<{
state: Addon_TestProviderState<{
testResults: TestResult[];
}>;
ListItem: typeof ListItem;
}> = ({ context, state, ListItem }) => {
}> = ({ context, state }) => {
const api = useStorybookApi();
const [isDisabled, setDisabled] = useState(false);

Expand Down
4 changes: 2 additions & 2 deletions code/addons/test/src/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ addons.register(ADDON_ID, (api) => {
watchable: true,
name: 'Component tests',

sidebarContextMenu: ({ context, state }, { ListItem }) => {
sidebarContextMenu: ({ context, state }) => {
if (context.type === 'docs') {
return null;
}
if (context.type === 'story' && !context.tags.includes('test')) {
return null;
}

return <ContextMenuItem context={context} state={state} ListItem={ListItem} />;
return <ContextMenuItem context={context} state={state} />;
},

render: (state) => <TestProviderRender api={api} state={state} />,
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/manager/components/sidebar/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function generateTestProviderLinks(
if (!state) {
return null;
}
const content = state.sidebarContextMenu?.({ context, state }, ContextMenu);
const content = state.sidebarContextMenu?.({ context, state });

if (!content) {
return null;
Expand Down

0 comments on commit f603ffb

Please sign in to comment.