Skip to content

Commit

Permalink
refactor: remove unsafe queries (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjastrzebski authored Nov 13, 2024
1 parent f5b27c2 commit e11afa3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 163 deletions.
80 changes: 0 additions & 80 deletions src/queries/unsafe-props.ts

This file was deleted.

64 changes: 0 additions & 64 deletions src/queries/unsafe-type.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ const defaultScreen: Screen = {
queryAllByRole: notImplemented,
findByRole: notImplemented,
findAllByRole: notImplemented,
UNSAFE_getByProps: notImplemented,
UNSAFE_getAllByProps: notImplemented,
UNSAFE_queryByProps: notImplemented,
UNSAFE_queryAllByProps: notImplemented,
UNSAFE_getByType: notImplemented,
UNSAFE_getAllByType: notImplemented,
UNSAFE_queryByType: notImplemented,
UNSAFE_queryAllByType: notImplemented,
getByPlaceholderText: notImplemented,
getAllByPlaceholderText: notImplemented,
queryByPlaceholderText: notImplemented,
Expand Down
18 changes: 7 additions & 11 deletions src/within.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import { HostElement } from 'universal-test-renderer';
import { bindByTextQueries } from './queries/text';
import { bindByTestIdQueries } from './queries/test-id';
import { bindByDisplayValueQueries } from './queries/display-value';
import { bindByPlaceholderTextQueries } from './queries/placeholder-text';
import { bindByLabelTextQueries } from './queries/label-text';
import { bindByHintTextQueries } from './queries/hint-text';
import { bindByLabelTextQueries } from './queries/label-text';
import { bindByPlaceholderTextQueries } from './queries/placeholder-text';
import { bindByRoleQueries } from './queries/role';
import { bindUnsafeByTypeQueries } from './queries/unsafe-type';
import { bindUnsafeByPropsQueries } from './queries/unsafe-props';
import { bindByTestIdQueries } from './queries/test-id';
import { bindByTextQueries } from './queries/text';

export function within(instance: HostElement) {
return {
...bindByTextQueries(instance),
...bindByTestIdQueries(instance),
...bindByDisplayValueQueries(instance),
...bindByPlaceholderTextQueries(instance),
...bindByLabelTextQueries(instance),
...bindByHintTextQueries(instance),
...bindByLabelTextQueries(instance),
...bindByRoleQueries(instance),
...bindUnsafeByTypeQueries(instance),
...bindUnsafeByPropsQueries(instance),
...bindByTestIdQueries(instance),
...bindByTextQueries(instance),
};
}

Expand Down

0 comments on commit e11afa3

Please sign in to comment.