Skip to content

Commit

Permalink
Merge pull request #30019 from storybookjs/30009-show-sub-test-provid…
Browse files Browse the repository at this point in the history
…er-toggle-state-in-main-testing-module

Addon Test: Show sub test provider toggle state in main testing module
  • Loading branch information
ghengeveld authored Dec 11, 2024
2 parents 25d6ef6 + 212f83a commit 2873e6c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion code/addons/test/src/components/ContextMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ContextMenuItem: FC<{
padding="small"
disabled={state.crashed || isDisabled}
>
<Icon fill={theme.barTextColor} />
<Icon fill={theme.textMutedColor} />
</Button>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/src/components/Description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const Wrapper = styled.div(({ theme }) => ({
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
fontSize: theme.typography.size.s1,
color: theme.barTextColor,
color: theme.textMutedColor,
}));

const PositiveText = styled.span(({ theme }) => ({
Expand Down
20 changes: 15 additions & 5 deletions code/addons/test/src/components/TestProviderRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ const StopIcon = styled(StopAltIcon)({
width: 10,
});

const ItemTitle = styled.span<{ enabled?: boolean }>(
({ enabled, theme }) =>
!enabled && {
color: theme.textMutedColor,
'&:after': {
content: '" (disabled)"',
},
}
);

const statusOrder: TestStatus[] = ['failed', 'warning', 'pending', 'passed', 'skipped'];
const statusMap: Record<TestStatus, ComponentProps<typeof TestStatusIcon>['status']> = {
failed: 'negative',
Expand Down Expand Up @@ -241,7 +251,7 @@ export const TestProviderRender: FC<
/>
<ListItem
as="label"
title="Coverage"
title={<ItemTitle enabled={config.coverage}>Coverage</ItemTitle>}
icon={<ShieldIcon color={theme.textMutedColor} />}
right={
<Checkbox
Expand All @@ -255,7 +265,7 @@ export const TestProviderRender: FC<
{isA11yAddon && (
<ListItem
as="label"
title="Accessibility"
title={<ItemTitle enabled={config.a11y}>Accessibility</ItemTitle>}
icon={<AccessibilityIcon color={theme.textMutedColor} />}
right={
<Checkbox
Expand Down Expand Up @@ -293,7 +303,7 @@ export const TestProviderRender: FC<
/>
{coverageSummary ? (
<ListItem
title="Coverage"
title={<ItemTitle enabled={config.coverage}>Coverage</ItemTitle>}
href={'/coverage/index.html'}
// @ts-expect-error ListItem doesn't include all anchor attributes in types, but it is an achor element
target="_blank"
Expand All @@ -308,13 +318,13 @@ export const TestProviderRender: FC<
/>
) : (
<ListItem
title="Coverage"
title={<ItemTitle enabled={config.coverage}>Coverage</ItemTitle>}
icon={<TestStatusIcon status="unknown" aria-label={`status: unknown`} />}
/>
)}
{isA11yAddon && (
<ListItem
title="Accessibility"
title={<ItemTitle enabled={config.a11y}>Accessibility</ItemTitle>}
onClick={
(a11yStatus === 'negative' || a11yStatus === 'warning') && a11yResults.length
? () => {
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/components/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ProgressBar = styled.div(({ theme }) => ({
const ProgressMessage = styled.div(({ theme }) => ({
minHeight: '2em',
fontSize: `${theme.typography.size.s1}px`,
color: theme.barTextColor,
color: theme.textMutedColor,
}));

const ErrorIcon = styled(LightningOffIcon)(({ theme }) => ({
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/components/components/tooltip/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Title = styled(({ active, loading, disabled, ...rest }: TitleProps) => <sp
({ disabled, theme }) =>
disabled
? {
color: transparentize(0.7, theme.color.defaultText),
color: theme.textMutedColor,
}
: {}
);
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/manager/components/sidebar/LegacyRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const TitleWrapper = styled.div<{ crashed?: boolean }>(({ crashed, theme }) => (

const DescriptionWrapper = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s1,
color: theme.barTextColor,
color: theme.textMutedColor,
}));

const Progress = styled(ProgressSpinner)({
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/manager/components/sidebar/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const NoResults = styled.div(({ theme }) => ({
lineHeight: `18px`,
color: theme.color.defaultText,
small: {
color: theme.barTextColor,
color: theme.textMutedColor,
fontSize: `${theme.typography.size.s1}px`,
},
}));
Expand Down

0 comments on commit 2873e6c

Please sign in to comment.