File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change
1
+ export function matchArrayValue (
2
+ prop : Array < string > | undefined ,
3
+ matcher : string | Array < string >
4
+ ) : boolean {
5
+ if ( ! prop || matcher . length === 0 ) {
6
+ return false ;
7
+ }
8
+
9
+ if ( typeof matcher === 'string' ) {
10
+ return prop . includes ( matcher ) ;
11
+ }
12
+
13
+ return ! matcher . some ( ( e ) => ! prop . includes ( e ) ) ;
14
+ }
Original file line number Diff line number Diff line change 1
1
import type { ReactTestInstance } from 'react-test-renderer' ;
2
2
import { AccessibilityState } from 'react-native' ;
3
+ import { matchArrayValue } from '../helpers/matchers/matchArrayValue' ;
3
4
import { makeQueries } from './makeQueries' ;
4
5
import type {
5
6
FindAllByQuery ,
@@ -15,21 +16,6 @@ type AccessibilityStateKeys =
15
16
| AccessibilityStateKey
16
17
| Array < AccessibilityStateKey > ;
17
18
18
- export function matchArrayValue (
19
- prop : Array < string > | undefined ,
20
- matcher : string | Array < string >
21
- ) : boolean {
22
- if ( ! prop || matcher . length === 0 ) {
23
- return false ;
24
- }
25
-
26
- if ( typeof matcher === 'string' ) {
27
- return prop . includes ( matcher ) ;
28
- }
29
-
30
- return ! matcher . some ( ( e ) => ! prop . includes ( e ) ) ;
31
- }
32
-
33
19
const queryAllByA11yStates = (
34
20
instance : ReactTestInstance
35
21
) : ( (
You can’t perform that action at this time.
0 commit comments