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

Core: Improve aria labels using test provider name property #29375

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/addons/test/src/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ addons.register(ADDON_ID, (api) => {
runnable: true,
watchable: true,

name: 'Component tests',
title: ({ crashed }) => (crashed ? "Component tests didn't complete" : 'Component tests'),
description: ({ failed, running, watching, progress, crashed, details }) => {
const [isModalOpen, setIsModalOpen] = useState(false);
Expand Down
6 changes: 3 additions & 3 deletions code/core/src/manager/components/sidebar/TestingModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export const TestingModule = ({
<Actions>
{state.watchable && (
<Button
aria-label="Toggle watch mode"
aria-label={`${state.watching ? 'Disable' : 'Enable'} watch mode for ${state.name}`}
ghengeveld marked this conversation as resolved.
Show resolved Hide resolved
variant="ghost"
padding="small"
active={state.watching}
Expand All @@ -255,7 +255,7 @@ export const TestingModule = ({
<>
{state.running && state.cancellable ? (
<Button
aria-label={`Cancel tests`}
aria-label={`Stop ${state.name}`}
ghengeveld marked this conversation as resolved.
Show resolved Hide resolved
variant="ghost"
padding="small"
onClick={() => onCancelTests(state.id)}
Expand All @@ -265,7 +265,7 @@ export const TestingModule = ({
</Button>
) : (
<Button
aria-label={`Run ${state.title}`}
aria-label={`Start ${state.name}`}
ghengeveld marked this conversation as resolved.
Show resolved Hide resolved
variant="ghost"
padding="small"
onClick={() => onRunTests(state.id)}
Expand Down
1 change: 1 addition & 0 deletions code/core/src/types/modules/addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ export interface Addon_TestProviderType<
type: Addon_TypesEnum.experimental_TEST_PROVIDER;
/** The unique id of the test provider. */
id: string;
name: string;
ghengeveld marked this conversation as resolved.
Show resolved Hide resolved
title: (state: Addon_TestProviderState<Details>) => ReactNode;
description: (state: Addon_TestProviderState<Details>) => ReactNode;
mapStatusUpdate?: (state: Addon_TestProviderState<Details>) => API_StatusUpdate;
Expand Down