Skip to content

Commit 5686241

Browse files
authored
chore: Remove some todo items (#3772)
1 parent 354493e commit 5686241

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

src/__a11y__/to-validate-a11y.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ const htmlValidator = new HtmlValidate({
3030
},
3131
});
3232

33-
// Polyfill for Array.prototype.flatMap
34-
function flatMap<Input, Output>(arr: ReadonlyArray<Input>, fn: (t: Input) => Output[]) {
35-
return arr.reduce((acc: Output[], item: Input) => {
36-
for (const flatItem of fn(item)) {
37-
acc.push(flatItem);
38-
}
39-
return acc;
40-
}, []);
41-
}
42-
4333
function formatMessages(prefix: string, messages: Array<string>) {
4434
if (messages.length === 0) {
4535
return '';
@@ -73,8 +63,7 @@ async function toValidateA11y(this: jest.MatcherUtils, element: HTMLElement) {
7363
const htmlViolations = (htmlValidateResult.results[0]?.messages || []).map(
7464
message => `${message.message} [${message.ruleId}]`
7565
);
76-
// TODO: remove polyfill with es2019 support
77-
const flattenAxeViolations = flatMap(axeViolations, violation =>
66+
const flattenAxeViolations = axeViolations.flatMap(violation =>
7867
violation.nodes.map(node => `[${violation.id}] ${node.failureSummary} Selector: ${node.target}`)
7968
);
8069

src/app-layout/__tests__/main.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ describeEachAppLayout({ themes: ['classic', 'refresh-toolbar'], sizes: ['desktop
4949
},
5050
],
5151
] as const)('%s', (name, { propName, handlerName, findToggle, findOpenElement, findClose }) => {
52-
// TODO: enable after fixing 'tools controlled property'
53-
(theme === 'refresh-toolbar' && name === 'tools' ? test.skip : test)('property is controlled', () => {
52+
test('property is controlled', () => {
5453
const onChange = jest.fn();
5554
const { wrapper, rerender } = renderComponent(<AppLayout {...{ [propName]: false, [handlerName]: onChange }} />);
5655
findToggle(wrapper).click();

src/app-layout/__tests__/state.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ describeEachAppLayout({ themes: ['refresh-toolbar'] }, () => {
2828
expect(refSpy).toHaveBeenCalledWith(null);
2929
});
3030

31-
// does not work without this fix: https://github.com/cloudscape-design/component-toolkit/pull/151
32-
test.skip('content dom reference is preserved when changing switching between desktop and mobile', () => {
31+
test('content dom reference is preserved when changing switching between desktop and mobile', () => {
3332
const refSpy = jest.fn();
3433
renderComponent(<AppLayout content={<div ref={refSpy}>content</div>} />);
3534

0 commit comments

Comments
 (0)