Skip to content

Commit 14cf05a

Browse files
authored
Merge branch 'develop' into fix/password-toggle-accessibility-3850
2 parents 9544c14 + a2539b1 commit 14cf05a

25 files changed

+566
-349
lines changed

client/modules/IDE/components/AddToCollectionSketchList.unit.test.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ describe('<AddToCollectionSketchList />', () => {
119119

120120
const before = requestCount;
121121

122-
fireEvent.click(screen.getByRole('button', { name: 'Next Page' }));
122+
fireEvent.click(
123+
screen.getByRole('button', { name: 'Pagination.NextPageARIA' })
124+
);
123125

124126
await waitFor(() => {
125127
expect(requestCount).toBeGreaterThan(before);
@@ -134,7 +136,7 @@ describe('<AddToCollectionSketchList />', () => {
134136
await screen.findByText('page1-sketch-1');
135137

136138
expect(
137-
screen.getByRole('button', { name: 'Previous Page' })
139+
screen.getByRole('button', { name: 'Pagination.PreviousPageARIA' })
138140
).toBeDisabled();
139141
});
140142

@@ -165,7 +167,7 @@ describe('<AddToCollectionSketchList />', () => {
165167
await screen.findByText('AddToCollectionSketchList.NoCollections');
166168

167169
expect(
168-
screen.queryByRole('button', { name: 'Next Page' })
170+
screen.queryByRole('button', { name: 'Pagination.NextPageARIA' })
169171
).not.toBeInTheDocument();
170172
});
171173

@@ -253,13 +255,17 @@ describe('<AddToCollectionSketchList />', () => {
253255
let info = document.querySelector('.pagination-info');
254256
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain('1 - 10');
255257

256-
fireEvent.click(screen.getByRole('button', { name: 'Next Page' }));
258+
fireEvent.click(
259+
screen.getByRole('button', { name: 'Pagination.NextPageARIA' })
260+
);
257261
await screen.findByText('page2-sketch-1');
258262

259263
info = document.querySelector('.pagination-info');
260264
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain('11 - 20');
261265

262-
fireEvent.click(screen.getByRole('button', { name: 'Next Page' }));
266+
fireEvent.click(
267+
screen.getByRole('button', { name: 'Pagination.NextPageARIA' })
268+
);
263269
await screen.findByText('page3-sketch-1');
264270

265271
info = document.querySelector('.pagination-info');

client/modules/IDE/components/Pagination.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Pagination = ({
2626
className="page-link"
2727
onClick={() => onPageChange(page - 1)}
2828
disabled={page === 1}
29-
aria-label="Previous Page"
29+
aria-label={t('Pagination.PreviousPageARIA')}
3030
>
3131
{t('Pagination.Previous')}
3232
</button>
@@ -51,7 +51,7 @@ const Pagination = ({
5151
onPageChange(page + 1);
5252
}}
5353
disabled={page === totalPages}
54-
aria-label="Next Page"
54+
aria-label={t('Pagination.NextPageARIA')}
5555
>
5656
{t('Pagination.Next')}
5757
</button>

client/modules/IDE/components/QuickAddList/Icons.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import { useTranslation } from 'react-i18next';
34
import CloseIcon from '../../../../images/close.svg';
45
import CheckIcon from '../../../../images/check_encircled.svg';
56

67
const Icons = ({ isAdded }) => {
8+
const { t } = useTranslation();
79
const classes = [
810
'quick-add__icon',
911
isAdded
@@ -16,13 +18,13 @@ const Icons = ({ isAdded }) => {
1618
<CloseIcon
1719
className="quick-add__remove-icon"
1820
role="img"
19-
aria-label="Descending"
21+
aria-label={t('QuickAddList.ButtonRemoveARIA')}
2022
focusable="false"
2123
/>
2224
<CheckIcon
2325
className="quick-add__add-icon"
2426
role="img"
25-
aria-label="Descending"
27+
aria-label={t('QuickAddList.ButtonAddToCollectionARIA')}
2628
focusable="false"
2729
/>
2830
</div>

client/modules/IDE/components/SketchList.unit.test.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('<SketchList />', () => {
134134

135135
expect(screen.queryByRole('table')).not.toBeInTheDocument();
136136
expect(
137-
screen.queryByRole('button', { name: 'Next Page' })
137+
screen.queryByRole('button', { name: 'Pagination.NextPageARIA' })
138138
).not.toBeInTheDocument();
139139
});
140140

@@ -195,7 +195,9 @@ describe('<SketchList />', () => {
195195

196196
const before = requestCount;
197197

198-
fireEvent.click(screen.getByRole('button', { name: 'Next Page' }));
198+
fireEvent.click(
199+
screen.getByRole('button', { name: 'Pagination.NextPageARIA' })
200+
);
199201

200202
await waitFor(() => {
201203
expect(requestCount).toBeGreaterThan(before);
@@ -209,7 +211,9 @@ describe('<SketchList />', () => {
209211
subject();
210212
await screen.findByText('page1-sketch-1');
211213

212-
const prev = screen.getByRole('button', { name: 'Previous Page' });
214+
const prev = screen.getByRole('button', {
215+
name: 'Pagination.PreviousPageARIA'
216+
});
213217
expect(prev).toBeDisabled();
214218
});
215219

@@ -245,10 +249,10 @@ describe('<SketchList />', () => {
245249
await screen.findByText('singlePage-sketch-1');
246250

247251
expect(
248-
screen.queryByRole('button', { name: 'Previous Page' })
252+
screen.queryByRole('button', { name: 'Pagination.PreviousPageARIA' })
249253
).not.toBeInTheDocument();
250254
expect(
251-
screen.queryByRole('button', { name: 'Next Page' })
255+
screen.queryByRole('button', { name: 'Pagination.NextPageARIA' })
252256
).not.toBeInTheDocument();
253257
});
254258
});

client/modules/IDE/components/TextArea.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function TextArea({ src, className }) {
3232
<TextAreaWrapper>
3333
<textarea className={className}>{src}</textarea>
3434
<CornerButton onClick={copyTextToClipboard}>
35-
<CopyIcon aria-label="Copy" />
35+
<CopyIcon aria-label={t('TextArea.CopyARIA')} />
3636
</CornerButton>
3737
</TextAreaWrapper>
3838
);

client/modules/IDE/components/Toast.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function Toast() {
1818
<button
1919
className="toast__close"
2020
onClick={() => dispatch(hideToast())}
21-
aria-label="Close Alert"
21+
aria-label={t('Toast.CloseAlertARIA')}
2222
>
2323
<ExitIcon focusable="false" aria-hidden="true" />
2424
</button>

client/modules/IDE/components/VersionPicker.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const VersionPicker = React.forwardRef(({ onChangeVersion }, ref) => {
7777
return (
7878
<VersionDropdownMenu
7979
className="versionPicker"
80-
aria-label="Select p5.js version"
80+
aria-label={t('Toolbar.SelectVersionARIA')}
8181
anchor={
8282
<VersionPickerButton ref={ref}>
8383
<VersionPickerText>

0 commit comments

Comments
 (0)