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

chore: deprecate some a11y queries #1226

Merged
merged 11 commits into from
Jan 28, 2023
24 changes: 12 additions & 12 deletions src/queries/__tests__/a11yState.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,42 +267,42 @@ test('*ByA11yState deprecation warnings', () => {
expect(mockCalls[0][0]).toMatchInlineSnapshot(`
"getByA11yState(...) is deprecated and will be removed in the future.

Use getByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use getByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.getAllByA11yState({ disabled: true });
expect(mockCalls[1][0]).toMatchInlineSnapshot(`
"getAllByA11yState(...) is deprecated and will be removed in the future.

Use getAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use getAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.queryByA11yState({ disabled: true });
expect(mockCalls[2][0]).toMatchInlineSnapshot(`
"queryByA11yState(...) is deprecated and will be removed in the future.

Use queryByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use queryByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.queryAllByA11yState({ disabled: true });
expect(mockCalls[3][0]).toMatchInlineSnapshot(`
"queryAllByA11yState(...) is deprecated and will be removed in the future.

Use queryAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use queryAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.findByA11yState({ disabled: true });
expect(mockCalls[4][0]).toMatchInlineSnapshot(`
"findByA11yState(...) is deprecated and will be removed in the future.

Use findByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use findByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.findAllByA11yState({ disabled: true });
expect(mockCalls[5][0]).toMatchInlineSnapshot(`
"findAllByA11yState(...) is deprecated and will be removed in the future.

Use findAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use findAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);
});

Expand All @@ -314,41 +314,41 @@ test('*ByAccessibilityState deprecation warnings', () => {
expect(mockCalls[0][0]).toMatchInlineSnapshot(`
"getByAccessibilityState(...) is deprecated and will be removed in the future.

Use getByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use getByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.getAllByAccessibilityState({ disabled: true });
expect(mockCalls[1][0]).toMatchInlineSnapshot(`
"getAllByAccessibilityState(...) is deprecated and will be removed in the future.

Use getAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use getAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.queryByAccessibilityState({ disabled: true });
expect(mockCalls[2][0]).toMatchInlineSnapshot(`
"queryByAccessibilityState(...) is deprecated and will be removed in the future.

Use queryByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use queryByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.queryAllByAccessibilityState({ disabled: true });
expect(mockCalls[3][0]).toMatchInlineSnapshot(`
"queryAllByAccessibilityState(...) is deprecated and will be removed in the future.

Use queryAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use queryAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.findByAccessibilityState({ disabled: true });
expect(mockCalls[4][0]).toMatchInlineSnapshot(`
"findByAccessibilityState(...) is deprecated and will be removed in the future.

Use findByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use findByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);

view.findAllByAccessibilityState({ disabled: true });
expect(mockCalls[5][0]).toMatchInlineSnapshot(`
"findAllByAccessibilityState(...) is deprecated and will be removed in the future.

Use findAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead."
Use findAllByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead."
`);
});
24 changes: 12 additions & 12 deletions src/queries/__tests__/a11yValue.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,42 +146,42 @@ test('*ByA11yValue deprecation warnings', () => {
expect(mockCalls[0][0]).toMatchInlineSnapshot(`
"getByA11yValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or getByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or getByRole(role, { value: ... }) query instead."
`);

view.getAllByA11yValue({ min: 10 });
expect(mockCalls[1][0]).toMatchInlineSnapshot(`
"getAllByA11yValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or getAllByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or getAllByRole(role, { value: ... }) query instead."
`);

view.queryByA11yValue({ min: 10 });
expect(mockCalls[2][0]).toMatchInlineSnapshot(`
"queryByA11yValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or queryByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or queryByRole(role, { value: ... }) query instead."
`);

view.queryAllByA11yValue({ min: 10 });
expect(mockCalls[3][0]).toMatchInlineSnapshot(`
"queryAllByA11yValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or queryAllByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or queryAllByRole(role, { value: ... }) query instead."
`);

view.findByA11yValue({ min: 10 });
expect(mockCalls[4][0]).toMatchInlineSnapshot(`
"findByA11yValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or findByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or findByRole(role, { value: ... }) query instead."
`);

view.findAllByA11yValue({ min: 10 });
expect(mockCalls[5][0]).toMatchInlineSnapshot(`
"findAllByA11yValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or findAllByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or findAllByRole(role, { value: ... }) query instead."
`);
});

Expand All @@ -193,41 +193,41 @@ test('*ByAccessibilityValue deprecation warnings', () => {
expect(mockCalls[0][0]).toMatchInlineSnapshot(`
"getByAccessibilityValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or getByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or getByRole(role, { value: ... }) query instead."
`);

view.getAllByAccessibilityValue({ min: 10 });
expect(mockCalls[1][0]).toMatchInlineSnapshot(`
"getAllByAccessibilityValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or getAllByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or getAllByRole(role, { value: ... }) query instead."
`);

view.queryByAccessibilityValue({ min: 10 });
expect(mockCalls[2][0]).toMatchInlineSnapshot(`
"queryByAccessibilityValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or queryByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or queryByRole(role, { value: ... }) query instead."
`);

view.queryAllByAccessibilityValue({ min: 10 });
expect(mockCalls[3][0]).toMatchInlineSnapshot(`
"queryAllByAccessibilityValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or queryAllByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or queryAllByRole(role, { value: ... }) query instead."
`);

view.findByAccessibilityValue({ min: 10 });
expect(mockCalls[4][0]).toMatchInlineSnapshot(`
"findByAccessibilityValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or findByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or findByRole(role, { value: ... }) query instead."
`);

view.findAllByAccessibilityValue({ min: 10 });
expect(mockCalls[5][0]).toMatchInlineSnapshot(`
"findAllByAccessibilityValue(...) is deprecated and will be removed in the future.

Use expect(...).toHaveAccessibilityValue(...) matcher or findAllByRole(role, { value: ... }) query instead."
Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or findAllByRole(role, { value: ... }) query instead."
`);
});
2 changes: 1 addition & 1 deletion src/queries/a11yState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const bindByA11yStateQueries = (
findByAccessibilityState: findByA11yState,
findAllByAccessibilityState: findAllByA11yState,
},
'Use {queryPrefix}ByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead.'
'Use {queryPrefix}ByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher from @testing-library/jest-nativ package instead.'
mdjastrzebski marked this conversation as resolved.
Show resolved Hide resolved
),
};
};
2 changes: 1 addition & 1 deletion src/queries/a11yValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const bindByA11yValueQueries = (
findByAccessibilityValue: findByA11yValue,
findAllByAccessibilityValue: findAllByA11yValue,
},
'Use expect(...).toHaveAccessibilityValue(...) matcher or {queryPrefix}ByRole(role, { value: ... }) query instead.'
'Use expect(...).toHaveAccessibilityValue(...) matcher from @testing-library/jest-native package or {queryPrefix}ByRole(role, { value: ... }) query instead.'
),
};
};