Merge pull request #18515 from nwpappas/status-a11y-fix

Fix Status a11y concerns
This commit is contained in:
Ben Lambert
2023-07-10 14:05:23 +02:00
committed by GitHub
4 changed files with 98 additions and 70 deletions
@@ -24,19 +24,19 @@ describe('StatusIcon', () => {
let rendered = await renderInTestApp(
<StatusIcon buildStatus="succeeded" />,
);
expect(rendered.getByLabelText('Status ok')).toBeInTheDocument();
expect(rendered.getByLabelText('Ok')).toBeInTheDocument();
rendered = await renderInTestApp(<StatusIcon buildStatus="failed" />);
expect(rendered.getByLabelText('Status error')).toBeInTheDocument();
expect(rendered.getByLabelText('Error')).toBeInTheDocument();
rendered = await renderInTestApp(<StatusIcon buildStatus="stopped" />);
expect(rendered.getByLabelText('Status warning')).toBeInTheDocument();
expect(rendered.getByLabelText('Warning')).toBeInTheDocument();
});
it('should render invalid statuses', async () => {
const rendered = await renderInTestApp(
<StatusIcon buildStatus={'invalid' as BuildStatus} />,
);
expect(rendered.getByLabelText('Status aborted')).toBeInTheDocument();
expect(rendered.getByLabelText('Aborted')).toBeInTheDocument();
});
});