Skip to content

Commit

Permalink
better name
Browse files Browse the repository at this point in the history
  • Loading branch information
jaworek authored and mdjastrzebski committed Sep 1, 2023
1 parent fd33357 commit 515b447
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/matchers/__tests__/to-be-disabled.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ import {
import { render } from '../..';
import '../extend-expect';

const ALLOWED_COMPONENTS = {
const DISABLED_PROP_COMPONENTS = {
TouchableHighlight,
TouchableOpacity,
TouchableWithoutFeedback,
TouchableNativeFeedback,
Pressable,
};

const ARIA_COMPONENTS = {
const ARIA_DISABLED_PROP_COMPONENTS = {
View,
TextInput,
};

const ALL_COMPONENTS = { ...ALLOWED_COMPONENTS, ...ARIA_COMPONENTS };
const ALL_COMPONENTS = {
...DISABLED_PROP_COMPONENTS,
...ARIA_DISABLED_PROP_COMPONENTS,
};

describe('.toBeDisabled', () => {
Object.entries(ALLOWED_COMPONENTS).forEach(([name, Component]) => {
Object.entries(DISABLED_PROP_COMPONENTS).forEach(([name, Component]) => {
test(`handle disabled prop for element ${name}`, () => {
const { queryByTestId } = render(
//@ts-expect-error JSX element type 'Component' does not have any construct or call signatures.ts(2604)
Expand All @@ -42,7 +45,7 @@ describe('.toBeDisabled', () => {
});
});

Object.entries(ARIA_COMPONENTS).forEach(([name, Component]) => {
Object.entries(ARIA_DISABLED_PROP_COMPONENTS).forEach(([name, Component]) => {
test(`handle aria-disabled prop for element ${name}`, () => {
const { queryByTestId } = render(
<Component aria-disabled testID={name}>
Expand Down

0 comments on commit 515b447

Please sign in to comment.