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

Fix iseec 2378 UI shell accessibility #49

Merged
merged 14 commits into from
Jan 26, 2022
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,20 @@
},
"dependencies": {
"@carbon/elements": "^10.21.0",
"@carbon/themes": "^10.21.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed redundant dependency

"@stomp/stompjs": "^5.4.2",
"@tippyjs/react": "^4.0.2",
"carbon-icons": "^7.0.7",
"classnames": "^2.2.5",
"date-fns": "^1.30.1",
"dompurify": "^2.0.6",
"downshift": "^5.2.1",
"invariant": "^2.2.3",
"focus-trap-react": "^8.9.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dependencies that aren't used and migrated to use of a better focus trap library for focus management from the UIShell

"js-file-download": "^0.4.7",
"lodash.isequal": "^4.5.0",
"match-sorter": "^4.2.1",
"react-autosuggest": "^9.4.3",
"react-dropzone": "^10.0.6",
"react-focus-trap": "^2.7.1",
"react-modal": "^3.10.1",
"react-toastify": "^5.3.2",
"warning": "^4.0.3",
"window-or-global": "^1.0.1"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/components/AboutPlatform/AboutPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const AboutPlatformContainer = ({ version, organization, isFlowApp }) => {
<li key="kubernetes-icon">
<a href="https://kubernetes.io/" target="_blank" rel="noopener noreferrer">
<KubernetesIcon
alt="Kubernetes Icon"
className={`${prefix}--bmrg-aboutPlatform-images__img`}
/>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('select and remove items', async () => {
expect(queryByLabelText(/Clear filter cat/i)).toBeInTheDocument();
});

const clearButton = getByRole('button', { name: 'Clear Selection' });
const clearButton = getByRole('button', { name: 'Clear selected item' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix test

fireEvent.click(clearButton);
await waitFor(() => {
expect(queryByLabelText(/Clear filter panda/i)).not.toBeInTheDocument();
Expand Down
6 changes: 3 additions & 3 deletions src/components/Error403/Error403.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Error403 from './Error403';

test('render Error403 with defaults', async () => {
const { getByText } = render(<Error403 />);
expect(getByText('403 - Access Forbidden')).toBeInTheDocument();
expect(getByText('You’ve found yourself in deep water.')).toBeInTheDocument();
expect(getByText('403 Access Forbidden')).toBeInTheDocument();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix test

expect(getByText(`Looks like you've taken a wrong turn.`)).toBeInTheDocument();
expect(
getByText('You shouldn’t be here - contact the local authorities if you disagree.')
).toBeInTheDocument();
Expand All @@ -14,7 +14,7 @@ test('render Error403 with defaults', async () => {
test('render Error403 without text', async () => {
const { queryByText } = render(<Error403 header={null} title={null} message={null} />);
expect(queryByText('403 - Access Forbidden')).not.toBeInTheDocument();
expect(queryByText('You’ve found yourself in deep water.')).not.toBeInTheDocument();
expect(queryByText(`Looks like you've taken a wrong turn.`)).not.toBeInTheDocument();
expect(
queryByText('You shouldn’t be here - contact the local authorities if you disagree.')
).not.toBeInTheDocument();
Expand Down
8 changes: 4 additions & 4 deletions src/components/Error404/Error404.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import Error404 from './Error404';

test('render Error404 with defaults', async () => {
const { getByText } = render(<Error404 />);
expect(getByText('404 - Page Not Found')).toBeInTheDocument();
expect(getByText('Crikey. Something seems to have swam off with this page.')).toBeInTheDocument();
expect(getByText('404 Page Not Found')).toBeInTheDocument();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix test

expect(getByText('We spaced out and couldn’t find your page.')).toBeInTheDocument();
expect(getByText('Try refreshing, or contact the local authorities.')).toBeInTheDocument();
});

test('render Error404 without text', async () => {
const { queryByText } = render(<Error404 header={null} title={null} message={null} />);
expect(queryByText('403 - Access Forbidden')).not.toBeInTheDocument();
expect(queryByText('You’ve found yourself in deep water.')).not.toBeInTheDocument();
expect(queryByText('404 Page Not Found')).not.toBeInTheDocument();
expect(queryByText('We spaced out and couldn’t find your page.')).not.toBeInTheDocument();
expect(
queryByText('You shouldn’t be here - contact the local authorities if you disagree.')
).not.toBeInTheDocument();
Expand Down
Loading