@testing-library/react-native 11.4.0 → 11.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/act.d.ts +3 -1
- package/build/act.js +1 -13
- package/build/act.js.map +1 -1
- package/build/cleanup.d.ts +1 -1
- package/build/config.d.ts +31 -2
- package/build/config.js +28 -3
- package/build/config.js.map +1 -1
- package/build/fireEvent.js +3 -3
- package/build/fireEvent.js.map +1 -1
- package/build/flushMicroTasks.d.ts +1 -1
- package/build/helpers/accessiblity.d.ts +11 -4
- package/build/helpers/accessiblity.js +29 -9
- package/build/helpers/accessiblity.js.map +1 -1
- package/build/helpers/debugDeep.d.ts +1 -1
- package/build/helpers/findAll.d.ts +10 -0
- package/build/helpers/findAll.js +44 -0
- package/build/helpers/findAll.js.map +1 -0
- package/build/helpers/format.d.ts +2 -2
- package/build/helpers/getTextContent.d.ts +2 -0
- package/build/helpers/getTextContent.js +20 -0
- package/build/helpers/getTextContent.js.map +1 -0
- package/build/helpers/host-component-names.d.ts +2 -0
- package/build/helpers/host-component-names.js +50 -0
- package/build/helpers/host-component-names.js.map +1 -0
- package/build/helpers/matchers/accessibilityValue.d.ts +9 -0
- package/build/helpers/matchers/accessibilityValue.js +12 -0
- package/build/helpers/matchers/accessibilityValue.js.map +1 -0
- package/build/helpers/matchers/matchLabelText.d.ts +3 -0
- package/build/helpers/matchers/matchLabelText.js +26 -0
- package/build/helpers/matchers/matchLabelText.js.map +1 -0
- package/build/helpers/matchers/matchTextContent.d.ts +10 -0
- package/build/helpers/matchers/matchTextContent.js +24 -0
- package/build/helpers/matchers/matchTextContent.js.map +1 -0
- package/build/helpers/timers.d.ts +0 -2
- package/build/helpers/timers.js.map +1 -1
- package/build/index.flow.js +123 -54
- package/build/matches.d.ts +7 -3
- package/build/matches.js.map +1 -1
- package/build/pure.d.ts +12 -23
- package/build/pure.js +8 -2
- package/build/pure.js.map +1 -1
- package/build/queries/a11yState.d.ts +15 -14
- package/build/queries/a11yState.js +3 -2
- package/build/queries/a11yState.js.map +1 -1
- package/build/queries/a11yValue.d.ts +15 -20
- package/build/queries/a11yValue.js +16 -5
- package/build/queries/a11yValue.js.map +1 -1
- package/build/queries/displayValue.d.ts +11 -9
- package/build/queries/displayValue.js +7 -2
- package/build/queries/displayValue.js.map +1 -1
- package/build/queries/hintText.d.ts +23 -21
- package/build/queries/hintText.js +2 -1
- package/build/queries/hintText.js.map +1 -1
- package/build/queries/labelText.d.ts +11 -9
- package/build/queries/labelText.js +7 -11
- package/build/queries/labelText.js.map +1 -1
- package/build/queries/makeQueries.d.ts +8 -8
- package/build/queries/options.d.ts +11 -0
- package/build/queries/options.js +2 -0
- package/build/queries/options.js.map +1 -0
- package/build/queries/placeholderText.d.ts +11 -9
- package/build/queries/placeholderText.js +8 -3
- package/build/queries/placeholderText.js.map +1 -1
- package/build/queries/role.d.ts +7 -4
- package/build/queries/role.js +22 -11
- package/build/queries/role.js.map +1 -1
- package/build/queries/testId.d.ts +11 -9
- package/build/queries/testId.js +2 -2
- package/build/queries/testId.js.map +1 -1
- package/build/queries/text.d.ts +11 -13
- package/build/queries/text.js +24 -51
- package/build/queries/text.js.map +1 -1
- package/build/queries/unsafeProps.d.ts +1 -1
- package/build/queries/unsafeType.d.ts +1 -1
- package/build/render.d.ts +92 -146
- package/build/renderHook.d.ts +2 -2
- package/build/waitFor.d.ts +1 -1
- package/build/within.d.ts +90 -144
- package/package.json +17 -18
- package/typings/index.flow.js +123 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11yState.js","names":["queryAllByA11yState","instance","queryAllByA11yStateFn","matcher","findAll","node","type","matchAccessibilityState","buildErrorMessage","state","errors","accessibilityStateKeys","forEach","stateKey","undefined","push","join","getMultipleError","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByA11yStateQueries","getByA11yState","getAllByA11yState","queryByA11yState","findByA11yState","findAllByA11yState","getByAccessibilityState","getAllByAccessibilityState","queryByAccessibilityState","queryAllByAccessibilityState","findByAccessibilityState","findAllByAccessibilityState"],"sources":["../../src/queries/a11yState.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport
|
|
1
|
+
{"version":3,"file":"a11yState.js","names":["queryAllByA11yState","instance","queryAllByA11yStateFn","matcher","queryOptions","findAll","node","type","matchAccessibilityState","buildErrorMessage","state","errors","accessibilityStateKeys","forEach","stateKey","undefined","push","join","getMultipleError","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByA11yStateQueries","getByA11yState","getAllByA11yState","queryByA11yState","findByA11yState","findAllByA11yState","getByAccessibilityState","getAllByAccessibilityState","queryByAccessibilityState","queryAllByAccessibilityState","findByAccessibilityState","findAllByAccessibilityState"],"sources":["../../src/queries/a11yState.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { AccessibilityState } from 'react-native';\nimport { accessibilityStateKeys } from '../helpers/accessiblity';\nimport { findAll } from '../helpers/findAll';\nimport { matchAccessibilityState } from '../helpers/matchers/accessibilityState';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport { CommonQueryOptions } from './options';\n\nconst queryAllByA11yState = (\n instance: ReactTestInstance\n): ((\n matcher: AccessibilityState,\n queryOptions?: CommonQueryOptions\n) => Array<ReactTestInstance>) =>\n function queryAllByA11yStateFn(matcher, queryOptions) {\n return findAll(\n instance,\n (node) =>\n typeof node.type === 'string' && matchAccessibilityState(node, matcher),\n queryOptions\n );\n };\n\nconst buildErrorMessage = (state: AccessibilityState = {}) => {\n const errors: string[] = [];\n\n accessibilityStateKeys.forEach((stateKey) => {\n if (state[stateKey] !== undefined) {\n errors.push(`${stateKey} state: ${state[stateKey]}`);\n }\n });\n\n return errors.join(', ');\n};\n\nconst getMultipleError = (state: AccessibilityState) =>\n `Found multiple elements with ${buildErrorMessage(state)}`;\n\nconst getMissingError = (state: AccessibilityState) =>\n `Unable to find an element with ${buildErrorMessage(state)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByA11yState,\n getMissingError,\n getMultipleError\n);\n\nexport type ByA11yStateQueries = {\n getByA11yState: GetByQuery<AccessibilityState, CommonQueryOptions>;\n getAllByA11yState: GetAllByQuery<AccessibilityState, CommonQueryOptions>;\n queryByA11yState: QueryByQuery<AccessibilityState, CommonQueryOptions>;\n queryAllByA11yState: QueryAllByQuery<AccessibilityState, CommonQueryOptions>;\n findByA11yState: FindByQuery<AccessibilityState, CommonQueryOptions>;\n findAllByA11yState: FindAllByQuery<AccessibilityState, CommonQueryOptions>;\n\n getByAccessibilityState: GetByQuery<AccessibilityState, CommonQueryOptions>;\n getAllByAccessibilityState: GetAllByQuery<\n AccessibilityState,\n CommonQueryOptions\n >;\n queryByAccessibilityState: QueryByQuery<\n AccessibilityState,\n CommonQueryOptions\n >;\n queryAllByAccessibilityState: QueryAllByQuery<\n AccessibilityState,\n CommonQueryOptions\n >;\n findByAccessibilityState: FindByQuery<AccessibilityState, CommonQueryOptions>;\n findAllByAccessibilityState: FindAllByQuery<\n AccessibilityState,\n CommonQueryOptions\n >;\n};\n\nexport const bindByA11yStateQueries = (\n instance: ReactTestInstance\n): ByA11yStateQueries => {\n const getByA11yState = getBy(instance);\n const getAllByA11yState = getAllBy(instance);\n const queryByA11yState = queryBy(instance);\n const queryAllByA11yState = queryAllBy(instance);\n const findByA11yState = findBy(instance);\n const findAllByA11yState = findAllBy(instance);\n\n return {\n getByA11yState,\n getAllByA11yState,\n queryByA11yState,\n queryAllByA11yState,\n findByA11yState,\n findAllByA11yState,\n\n getByAccessibilityState: getByA11yState,\n getAllByAccessibilityState: getAllByA11yState,\n queryByAccessibilityState: queryByA11yState,\n queryAllByAccessibilityState: queryAllByA11yState,\n findByAccessibilityState: findByA11yState,\n findAllByAccessibilityState: findAllByA11yState,\n };\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AAWA,MAAMA,mBAAmB,GACvBC,QAA2B,IAK3B,SAASC,qBAAqB,CAACC,OAAO,EAAEC,YAAY,EAAE;EACpD,OAAO,IAAAC,gBAAO,EACZJ,QAAQ,EACPK,IAAI,IACH,OAAOA,IAAI,CAACC,IAAI,KAAK,QAAQ,IAAI,IAAAC,2CAAuB,EAACF,IAAI,EAAEH,OAAO,CAAC,EACzEC,YAAY,CACb;AACH,CAAC;AAEH,MAAMK,iBAAiB,GAAG,CAACC,KAAyB,GAAG,CAAC,CAAC,KAAK;EAC5D,MAAMC,MAAgB,GAAG,EAAE;EAE3BC,oCAAsB,CAACC,OAAO,CAAEC,QAAQ,IAAK;IAC3C,IAAIJ,KAAK,CAACI,QAAQ,CAAC,KAAKC,SAAS,EAAE;MACjCJ,MAAM,CAACK,IAAI,CAAE,GAAEF,QAAS,WAAUJ,KAAK,CAACI,QAAQ,CAAE,EAAC,CAAC;IACtD;EACF,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACM,IAAI,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED,MAAMC,gBAAgB,GAAIR,KAAyB,IAChD,gCAA+BD,iBAAiB,CAACC,KAAK,CAAE,EAAC;AAE5D,MAAMS,eAAe,GAAIT,KAAyB,IAC/C,kCAAiCD,iBAAiB,CAACC,KAAK,CAAE,EAAC;AAE9D,MAAM;EAAEU,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7E1B,mBAAmB,EACnBmB,eAAe,EACfD,gBAAgB,CACjB;AA8BM,MAAMS,sBAAsB,GACjC1B,QAA2B,IACJ;EACvB,MAAM2B,cAAc,GAAGR,KAAK,CAACnB,QAAQ,CAAC;EACtC,MAAM4B,iBAAiB,GAAGR,QAAQ,CAACpB,QAAQ,CAAC;EAC5C,MAAM6B,gBAAgB,GAAGR,OAAO,CAACrB,QAAQ,CAAC;EAC1C,MAAMD,mBAAmB,GAAGuB,UAAU,CAACtB,QAAQ,CAAC;EAChD,MAAM8B,eAAe,GAAGP,MAAM,CAACvB,QAAQ,CAAC;EACxC,MAAM+B,kBAAkB,GAAGP,SAAS,CAACxB,QAAQ,CAAC;EAE9C,OAAO;IACL2B,cAAc;IACdC,iBAAiB;IACjBC,gBAAgB;IAChB9B,mBAAmB;IACnB+B,eAAe;IACfC,kBAAkB;IAElBC,uBAAuB,EAAEL,cAAc;IACvCM,0BAA0B,EAAEL,iBAAiB;IAC7CM,yBAAyB,EAAEL,gBAAgB;IAC3CM,4BAA4B,EAAEpC,mBAAmB;IACjDqC,wBAAwB,EAAEN,eAAe;IACzCO,2BAA2B,EAAEN;EAC/B,CAAC;AACH,CAAC;AAAC"}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
|
+
import { AccessibilityValueMatcher } from '../helpers/matchers/accessibilityValue';
|
|
2
3
|
import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './makeQueries';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getAllByAccessibilityValue: GetAllByQuery<A11yValue>;
|
|
18
|
-
queryByAccessibilityValue: QueryByQuery<A11yValue>;
|
|
19
|
-
queryAllByAccessibilityValue: QueryAllByQuery<A11yValue>;
|
|
20
|
-
findByAccessibilityValue: FindByQuery<A11yValue>;
|
|
21
|
-
findAllByAccessibilityValue: FindAllByQuery<A11yValue>;
|
|
4
|
+
import { CommonQueryOptions } from './options';
|
|
5
|
+
export type ByA11yValueQueries = {
|
|
6
|
+
getByA11yValue: GetByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
7
|
+
getAllByA11yValue: GetAllByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
8
|
+
queryByA11yValue: QueryByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
9
|
+
queryAllByA11yValue: QueryAllByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
10
|
+
findByA11yValue: FindByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
11
|
+
findAllByA11yValue: FindAllByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
12
|
+
getByAccessibilityValue: GetByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
13
|
+
getAllByAccessibilityValue: GetAllByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
14
|
+
queryByAccessibilityValue: QueryByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
15
|
+
queryAllByAccessibilityValue: QueryAllByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
16
|
+
findByAccessibilityValue: FindByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
17
|
+
findAllByAccessibilityValue: FindAllByQuery<AccessibilityValueMatcher, CommonQueryOptions>;
|
|
22
18
|
};
|
|
23
19
|
export declare const bindByA11yValueQueries: (instance: ReactTestInstance) => ByA11yValueQueries;
|
|
24
|
-
export {};
|
|
@@ -4,13 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.bindByA11yValueQueries = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _accessiblity = require("../helpers/accessiblity");
|
|
8
|
+
var _findAll = require("../helpers/findAll");
|
|
9
|
+
var _accessibilityValue = require("../helpers/matchers/accessibilityValue");
|
|
8
10
|
var _makeQueries = require("./makeQueries");
|
|
9
|
-
const queryAllByA11yValue = instance => function queryAllByA11yValueFn(value) {
|
|
10
|
-
return
|
|
11
|
+
const queryAllByA11yValue = instance => function queryAllByA11yValueFn(value, queryOptions) {
|
|
12
|
+
return (0, _findAll.findAll)(instance, node => typeof node.type === 'string' && (0, _accessibilityValue.matchAccessibilityValue)(node, value), queryOptions);
|
|
11
13
|
};
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
+
const formatQueryParams = matcher => {
|
|
15
|
+
const params = [];
|
|
16
|
+
_accessiblity.accessiblityValueKeys.forEach(valueKey => {
|
|
17
|
+
if (matcher[valueKey] !== undefined) {
|
|
18
|
+
params.push(`${valueKey} value: ${matcher[valueKey]}`);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return params.join(', ');
|
|
22
|
+
};
|
|
23
|
+
const getMultipleError = matcher => `Found multiple elements with ${formatQueryParams(matcher)}`;
|
|
24
|
+
const getMissingError = matcher => `Unable to find an element with ${formatQueryParams(matcher)}`;
|
|
14
25
|
const {
|
|
15
26
|
getBy,
|
|
16
27
|
getAllBy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11yValue.js","names":["queryAllByA11yValue","instance","queryAllByA11yValueFn","value","findAll","node","type","
|
|
1
|
+
{"version":3,"file":"a11yValue.js","names":["queryAllByA11yValue","instance","queryAllByA11yValueFn","value","queryOptions","findAll","node","type","matchAccessibilityValue","formatQueryParams","matcher","params","accessiblityValueKeys","forEach","valueKey","undefined","push","join","getMultipleError","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByA11yValueQueries","getByA11yValue","getAllByA11yValue","queryByA11yValue","findByA11yValue","findAllByA11yValue","getByAccessibilityValue","getAllByAccessibilityValue","queryByAccessibilityValue","queryAllByAccessibilityValue","findByAccessibilityValue","findAllByAccessibilityValue"],"sources":["../../src/queries/a11yValue.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { accessiblityValueKeys } from '../helpers/accessiblity';\nimport { findAll } from '../helpers/findAll';\nimport {\n AccessibilityValueMatcher,\n matchAccessibilityValue,\n} from '../helpers/matchers/accessibilityValue';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport { CommonQueryOptions } from './options';\n\nconst queryAllByA11yValue = (\n instance: ReactTestInstance\n): ((\n value: AccessibilityValueMatcher,\n queryOptions?: CommonQueryOptions\n) => Array<ReactTestInstance>) =>\n function queryAllByA11yValueFn(value, queryOptions) {\n return findAll(\n instance,\n (node) =>\n typeof node.type === 'string' && matchAccessibilityValue(node, value),\n queryOptions\n );\n };\n\nconst formatQueryParams = (matcher: AccessibilityValueMatcher) => {\n const params: string[] = [];\n\n accessiblityValueKeys.forEach((valueKey) => {\n if (matcher[valueKey] !== undefined) {\n params.push(`${valueKey} value: ${matcher[valueKey]}`);\n }\n });\n\n return params.join(', ');\n};\n\nconst getMultipleError = (matcher: AccessibilityValueMatcher) =>\n `Found multiple elements with ${formatQueryParams(matcher)}`;\n\nconst getMissingError = (matcher: AccessibilityValueMatcher) =>\n `Unable to find an element with ${formatQueryParams(matcher)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByA11yValue,\n getMissingError,\n getMultipleError\n);\n\nexport type ByA11yValueQueries = {\n getByA11yValue: GetByQuery<AccessibilityValueMatcher, CommonQueryOptions>;\n getAllByA11yValue: GetAllByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n queryByA11yValue: QueryByQuery<AccessibilityValueMatcher, CommonQueryOptions>;\n queryAllByA11yValue: QueryAllByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n findByA11yValue: FindByQuery<AccessibilityValueMatcher, CommonQueryOptions>;\n findAllByA11yValue: FindAllByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n\n getByAccessibilityValue: GetByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n getAllByAccessibilityValue: GetAllByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n queryByAccessibilityValue: QueryByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n queryAllByAccessibilityValue: QueryAllByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n findByAccessibilityValue: FindByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n findAllByAccessibilityValue: FindAllByQuery<\n AccessibilityValueMatcher,\n CommonQueryOptions\n >;\n};\n\nexport const bindByA11yValueQueries = (\n instance: ReactTestInstance\n): ByA11yValueQueries => {\n const getByA11yValue = getBy(instance);\n const getAllByA11yValue = getAllBy(instance);\n const queryByA11yValue = queryBy(instance);\n const queryAllByA11yValue = queryAllBy(instance);\n const findByA11yValue = findBy(instance);\n const findAllByA11yValue = findAllBy(instance);\n\n return {\n getByA11yValue,\n getAllByA11yValue,\n queryByA11yValue,\n queryAllByA11yValue,\n findByA11yValue,\n findAllByA11yValue,\n\n getByAccessibilityValue: getByA11yValue,\n getAllByAccessibilityValue: getAllByA11yValue,\n queryByAccessibilityValue: queryByA11yValue,\n queryAllByAccessibilityValue: queryAllByA11yValue,\n findByAccessibilityValue: findByA11yValue,\n findAllByAccessibilityValue: findAllByA11yValue,\n };\n};\n"],"mappings":";;;;;;AACA;AACA;AACA;AAIA;AAWA,MAAMA,mBAAmB,GACvBC,QAA2B,IAK3B,SAASC,qBAAqB,CAACC,KAAK,EAAEC,YAAY,EAAE;EAClD,OAAO,IAAAC,gBAAO,EACZJ,QAAQ,EACPK,IAAI,IACH,OAAOA,IAAI,CAACC,IAAI,KAAK,QAAQ,IAAI,IAAAC,2CAAuB,EAACF,IAAI,EAAEH,KAAK,CAAC,EACvEC,YAAY,CACb;AACH,CAAC;AAEH,MAAMK,iBAAiB,GAAIC,OAAkC,IAAK;EAChE,MAAMC,MAAgB,GAAG,EAAE;EAE3BC,mCAAqB,CAACC,OAAO,CAAEC,QAAQ,IAAK;IAC1C,IAAIJ,OAAO,CAACI,QAAQ,CAAC,KAAKC,SAAS,EAAE;MACnCJ,MAAM,CAACK,IAAI,CAAE,GAAEF,QAAS,WAAUJ,OAAO,CAACI,QAAQ,CAAE,EAAC,CAAC;IACxD;EACF,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACM,IAAI,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED,MAAMC,gBAAgB,GAAIR,OAAkC,IACzD,gCAA+BD,iBAAiB,CAACC,OAAO,CAAE,EAAC;AAE9D,MAAMS,eAAe,GAAIT,OAAkC,IACxD,kCAAiCD,iBAAiB,CAACC,OAAO,CAAE,EAAC;AAEhE,MAAM;EAAEU,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7E1B,mBAAmB,EACnBmB,eAAe,EACfD,gBAAgB,CACjB;AA6CM,MAAMS,sBAAsB,GACjC1B,QAA2B,IACJ;EACvB,MAAM2B,cAAc,GAAGR,KAAK,CAACnB,QAAQ,CAAC;EACtC,MAAM4B,iBAAiB,GAAGR,QAAQ,CAACpB,QAAQ,CAAC;EAC5C,MAAM6B,gBAAgB,GAAGR,OAAO,CAACrB,QAAQ,CAAC;EAC1C,MAAMD,mBAAmB,GAAGuB,UAAU,CAACtB,QAAQ,CAAC;EAChD,MAAM8B,eAAe,GAAGP,MAAM,CAACvB,QAAQ,CAAC;EACxC,MAAM+B,kBAAkB,GAAGP,SAAS,CAACxB,QAAQ,CAAC;EAE9C,OAAO;IACL2B,cAAc;IACdC,iBAAiB;IACjBC,gBAAgB;IAChB9B,mBAAmB;IACnB+B,eAAe;IACfC,kBAAkB;IAElBC,uBAAuB,EAAEL,cAAc;IACvCM,0BAA0B,EAAEL,iBAAiB;IAC7CM,yBAAyB,EAAEL,gBAAgB;IAC3CM,4BAA4B,EAAEpC,mBAAmB;IACjDqC,wBAAwB,EAAEN,eAAe;IACzCO,2BAA2B,EAAEN;EAC/B,CAAC;AACH,CAAC;AAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
|
-
import { TextMatch } from '../matches';
|
|
2
|
+
import { TextMatch, TextMatchOptions } from '../matches';
|
|
3
3
|
import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './makeQueries';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import type { CommonQueryOptions } from './options';
|
|
5
|
+
type ByDisplayValueOptions = CommonQueryOptions & TextMatchOptions;
|
|
6
|
+
export type ByDisplayValueQueries = {
|
|
7
|
+
getByDisplayValue: GetByQuery<TextMatch, ByDisplayValueOptions>;
|
|
8
|
+
getAllByDisplayValue: GetAllByQuery<TextMatch, ByDisplayValueOptions>;
|
|
9
|
+
queryByDisplayValue: QueryByQuery<TextMatch, ByDisplayValueOptions>;
|
|
10
|
+
queryAllByDisplayValue: QueryAllByQuery<TextMatch, ByDisplayValueOptions>;
|
|
11
|
+
findByDisplayValue: FindByQuery<TextMatch, ByDisplayValueOptions>;
|
|
12
|
+
findAllByDisplayValue: FindAllByQuery<TextMatch, ByDisplayValueOptions>;
|
|
12
13
|
};
|
|
13
14
|
export declare const bindByDisplayValueQueries: (instance: ReactTestInstance) => ByDisplayValueQueries;
|
|
15
|
+
export {};
|
|
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.bindByDisplayValueQueries = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _filterNodeByType = require("../helpers/filterNodeByType");
|
|
9
|
+
var _findAll = require("../helpers/findAll");
|
|
9
10
|
var _matches = require("../matches");
|
|
11
|
+
var _config = require("../config");
|
|
12
|
+
var _hostComponentNames = require("../helpers/host-component-names");
|
|
10
13
|
var _makeQueries = require("./makeQueries");
|
|
11
14
|
const getTextInputNodeByDisplayValue = (node, value, options = {}) => {
|
|
12
15
|
const {
|
|
@@ -14,10 +17,12 @@ const getTextInputNodeByDisplayValue = (node, value, options = {}) => {
|
|
|
14
17
|
normalizer
|
|
15
18
|
} = options;
|
|
16
19
|
const nodeValue = node.props.value !== undefined ? node.props.value : node.props.defaultValue;
|
|
17
|
-
|
|
20
|
+
const shouldReturnHostTextInput = (0, _config.getConfig)().useBreakingChanges;
|
|
21
|
+
const textInputType = shouldReturnHostTextInput ? (0, _hostComponentNames.getHostComponentNames)().textInput : _reactNative.TextInput;
|
|
22
|
+
return (0, _filterNodeByType.filterNodeByType)(node, textInputType) && (0, _matches.matches)(value, nodeValue, normalizer, exact);
|
|
18
23
|
};
|
|
19
24
|
const queryAllByDisplayValue = instance => function queryAllByDisplayValueFn(displayValue, queryOptions) {
|
|
20
|
-
return
|
|
25
|
+
return (0, _findAll.findAll)(instance, node => getTextInputNodeByDisplayValue(node, displayValue, queryOptions), queryOptions);
|
|
21
26
|
};
|
|
22
27
|
const getMultipleError = displayValue => `Found multiple elements with display value: ${String(displayValue)} `;
|
|
23
28
|
const getMissingError = displayValue => `Unable to find an element with displayValue: ${String(displayValue)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayValue.js","names":["getTextInputNodeByDisplayValue","node","value","options","exact","normalizer","nodeValue","props","undefined","defaultValue","
|
|
1
|
+
{"version":3,"file":"displayValue.js","names":["getTextInputNodeByDisplayValue","node","value","options","exact","normalizer","nodeValue","props","undefined","defaultValue","shouldReturnHostTextInput","getConfig","useBreakingChanges","textInputType","getHostComponentNames","textInput","TextInput","filterNodeByType","matches","queryAllByDisplayValue","instance","queryAllByDisplayValueFn","displayValue","queryOptions","findAll","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByDisplayValueQueries","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","findByDisplayValue","findAllByDisplayValue"],"sources":["../../src/queries/displayValue.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { TextInput } from 'react-native';\nimport { filterNodeByType } from '../helpers/filterNodeByType';\nimport { findAll } from '../helpers/findAll';\nimport { matches, TextMatch, TextMatchOptions } from '../matches';\nimport { getConfig } from '../config';\nimport { getHostComponentNames } from '../helpers/host-component-names';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByDisplayValueOptions = CommonQueryOptions & TextMatchOptions;\n\nconst getTextInputNodeByDisplayValue = (\n node: ReactTestInstance,\n value: TextMatch,\n options: TextMatchOptions = {}\n) => {\n const { exact, normalizer } = options;\n const nodeValue =\n node.props.value !== undefined ? node.props.value : node.props.defaultValue;\n const shouldReturnHostTextInput = getConfig().useBreakingChanges;\n const textInputType = shouldReturnHostTextInput\n ? getHostComponentNames().textInput\n : TextInput;\n\n return (\n filterNodeByType(node, textInputType) &&\n matches(value, nodeValue, normalizer, exact)\n );\n};\n\nconst queryAllByDisplayValue = (\n instance: ReactTestInstance\n): ((\n displayValue: TextMatch,\n queryOptions?: ByDisplayValueOptions\n) => Array<ReactTestInstance>) =>\n function queryAllByDisplayValueFn(displayValue, queryOptions) {\n return findAll(\n instance,\n (node) =>\n getTextInputNodeByDisplayValue(node, displayValue, queryOptions),\n queryOptions\n );\n };\n\nconst getMultipleError = (displayValue: TextMatch) =>\n `Found multiple elements with display value: ${String(displayValue)} `;\nconst getMissingError = (displayValue: TextMatch) =>\n `Unable to find an element with displayValue: ${String(displayValue)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByDisplayValue,\n getMissingError,\n getMultipleError\n);\n\nexport type ByDisplayValueQueries = {\n getByDisplayValue: GetByQuery<TextMatch, ByDisplayValueOptions>;\n getAllByDisplayValue: GetAllByQuery<TextMatch, ByDisplayValueOptions>;\n queryByDisplayValue: QueryByQuery<TextMatch, ByDisplayValueOptions>;\n queryAllByDisplayValue: QueryAllByQuery<TextMatch, ByDisplayValueOptions>;\n findByDisplayValue: FindByQuery<TextMatch, ByDisplayValueOptions>;\n findAllByDisplayValue: FindAllByQuery<TextMatch, ByDisplayValueOptions>;\n};\n\nexport const bindByDisplayValueQueries = (\n instance: ReactTestInstance\n): ByDisplayValueQueries => ({\n getByDisplayValue: getBy(instance),\n getAllByDisplayValue: getAllBy(instance),\n queryByDisplayValue: queryBy(instance),\n queryAllByDisplayValue: queryAllBy(instance),\n findByDisplayValue: findBy(instance),\n findAllByDisplayValue: findAllBy(instance),\n});\n"],"mappings":";;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA,MAAMA,8BAA8B,GAAG,CACrCC,IAAuB,EACvBC,KAAgB,EAChBC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,MAAMG,SAAS,GACbL,IAAI,CAACM,KAAK,CAACL,KAAK,KAAKM,SAAS,GAAGP,IAAI,CAACM,KAAK,CAACL,KAAK,GAAGD,IAAI,CAACM,KAAK,CAACE,YAAY;EAC7E,MAAMC,yBAAyB,GAAG,IAAAC,iBAAS,GAAE,CAACC,kBAAkB;EAChE,MAAMC,aAAa,GAAGH,yBAAyB,GAC3C,IAAAI,yCAAqB,GAAE,CAACC,SAAS,GACjCC,sBAAS;EAEb,OACE,IAAAC,kCAAgB,EAAChB,IAAI,EAAEY,aAAa,CAAC,IACrC,IAAAK,gBAAO,EAAChB,KAAK,EAAEI,SAAS,EAAED,UAAU,EAAED,KAAK,CAAC;AAEhD,CAAC;AAED,MAAMe,sBAAsB,GAC1BC,QAA2B,IAK3B,SAASC,wBAAwB,CAACC,YAAY,EAAEC,YAAY,EAAE;EAC5D,OAAO,IAAAC,gBAAO,EACZJ,QAAQ,EACPnB,IAAI,IACHD,8BAA8B,CAACC,IAAI,EAAEqB,YAAY,EAAEC,YAAY,CAAC,EAClEA,YAAY,CACb;AACH,CAAC;AAEH,MAAME,gBAAgB,GAAIH,YAAuB,IAC9C,+CAA8CI,MAAM,CAACJ,YAAY,CAAE,GAAE;AACxE,MAAMK,eAAe,GAAIL,YAAuB,IAC7C,gDAA+CI,MAAM,CAACJ,YAAY,CAAE,EAAC;AAExE,MAAM;EAAEM,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ef,sBAAsB,EACtBQ,eAAe,EACfF,gBAAgB,CACjB;AAWM,MAAMU,yBAAyB,GACpCf,QAA2B,KACA;EAC3BgB,iBAAiB,EAAER,KAAK,CAACR,QAAQ,CAAC;EAClCiB,oBAAoB,EAAER,QAAQ,CAACT,QAAQ,CAAC;EACxCkB,mBAAmB,EAAER,OAAO,CAACV,QAAQ,CAAC;EACtCD,sBAAsB,EAAEY,UAAU,CAACX,QAAQ,CAAC;EAC5CmB,kBAAkB,EAAEP,MAAM,CAACZ,QAAQ,CAAC;EACpCoB,qBAAqB,EAAEP,SAAS,CAACb,QAAQ;AAC3C,CAAC,CAAC;AAAC"}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
|
-
import { TextMatch } from '../matches';
|
|
2
|
+
import { TextMatch, TextMatchOptions } from '../matches';
|
|
3
3
|
import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './makeQueries';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
import { CommonQueryOptions } from './options';
|
|
5
|
+
type ByHintTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
6
|
+
export type ByHintTextQueries = {
|
|
7
|
+
getByHintText: GetByQuery<TextMatch, ByHintTextOptions>;
|
|
8
|
+
getAllByHintText: GetAllByQuery<TextMatch, ByHintTextOptions>;
|
|
9
|
+
queryByHintText: QueryByQuery<TextMatch, ByHintTextOptions>;
|
|
10
|
+
queryAllByHintText: QueryAllByQuery<TextMatch, ByHintTextOptions>;
|
|
11
|
+
findByHintText: FindByQuery<TextMatch, ByHintTextOptions>;
|
|
12
|
+
findAllByHintText: FindAllByQuery<TextMatch, ByHintTextOptions>;
|
|
13
|
+
getByA11yHint: GetByQuery<TextMatch, ByHintTextOptions>;
|
|
14
|
+
getAllByA11yHint: GetAllByQuery<TextMatch, ByHintTextOptions>;
|
|
15
|
+
queryByA11yHint: QueryByQuery<TextMatch, ByHintTextOptions>;
|
|
16
|
+
queryAllByA11yHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;
|
|
17
|
+
findByA11yHint: FindByQuery<TextMatch, ByHintTextOptions>;
|
|
18
|
+
findAllByA11yHint: FindAllByQuery<TextMatch, ByHintTextOptions>;
|
|
19
|
+
getByAccessibilityHint: GetByQuery<TextMatch, ByHintTextOptions>;
|
|
20
|
+
getAllByAccessibilityHint: GetAllByQuery<TextMatch, ByHintTextOptions>;
|
|
21
|
+
queryByAccessibilityHint: QueryByQuery<TextMatch, ByHintTextOptions>;
|
|
22
|
+
queryAllByAccessibilityHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;
|
|
23
|
+
findByAccessibilityHint: FindByQuery<TextMatch, ByHintTextOptions>;
|
|
24
|
+
findAllByAccessibilityHint: FindAllByQuery<TextMatch, ByHintTextOptions>;
|
|
24
25
|
};
|
|
25
26
|
export declare const bindByHintTextQueries: (instance: ReactTestInstance) => ByHintTextQueries;
|
|
27
|
+
export {};
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.bindByHintTextQueries = void 0;
|
|
7
|
+
var _findAll = require("../helpers/findAll");
|
|
7
8
|
var _matches = require("../matches");
|
|
8
9
|
var _makeQueries = require("./makeQueries");
|
|
9
10
|
const getNodeByHintText = (node, text, options = {}) => {
|
|
@@ -14,7 +15,7 @@ const getNodeByHintText = (node, text, options = {}) => {
|
|
|
14
15
|
return (0, _matches.matches)(text, node.props.accessibilityHint, normalizer, exact);
|
|
15
16
|
};
|
|
16
17
|
const queryAllByHintText = instance => function queryAllByA11yHintFn(hint, queryOptions) {
|
|
17
|
-
return
|
|
18
|
+
return (0, _findAll.findAll)(instance, node => typeof node.type === 'string' && getNodeByHintText(node, hint, queryOptions), queryOptions);
|
|
18
19
|
};
|
|
19
20
|
const getMultipleError = hint => `Found multiple elements with accessibilityHint: ${String(hint)} `;
|
|
20
21
|
const getMissingError = hint => `Unable to find an element with accessibilityHint: ${String(hint)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hintText.js","names":["getNodeByHintText","node","text","options","exact","normalizer","matches","props","accessibilityHint","queryAllByHintText","instance","queryAllByA11yHintFn","hint","queryOptions","findAll","type","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByHintTextQueries","getByHintText","getAllByHintText","queryByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint"],"sources":["../../src/queries/hintText.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { matches, TextMatch } from '../matches';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport {
|
|
1
|
+
{"version":3,"file":"hintText.js","names":["getNodeByHintText","node","text","options","exact","normalizer","matches","props","accessibilityHint","queryAllByHintText","instance","queryAllByA11yHintFn","hint","queryOptions","findAll","type","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByHintTextQueries","getByHintText","getAllByHintText","queryByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint"],"sources":["../../src/queries/hintText.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { findAll } from '../helpers/findAll';\nimport { matches, TextMatch, TextMatchOptions } from '../matches';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport { CommonQueryOptions } from './options';\n\ntype ByHintTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst getNodeByHintText = (\n node: ReactTestInstance,\n text: TextMatch,\n options: TextMatchOptions = {}\n) => {\n const { exact, normalizer } = options;\n return matches(text, node.props.accessibilityHint, normalizer, exact);\n};\n\nconst queryAllByHintText = (\n instance: ReactTestInstance\n): ((\n hint: TextMatch,\n queryOptions?: ByHintTextOptions\n) => Array<ReactTestInstance>) =>\n function queryAllByA11yHintFn(hint, queryOptions) {\n return findAll(\n instance,\n (node) =>\n typeof node.type === 'string' &&\n getNodeByHintText(node, hint, queryOptions),\n queryOptions\n );\n };\n\nconst getMultipleError = (hint: TextMatch) =>\n `Found multiple elements with accessibilityHint: ${String(hint)} `;\nconst getMissingError = (hint: TextMatch) =>\n `Unable to find an element with accessibilityHint: ${String(hint)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByHintText,\n getMissingError,\n getMultipleError\n);\n\nexport type ByHintTextQueries = {\n getByHintText: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByHintText: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByHintText: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByHintText: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByHintText: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByHintText: FindAllByQuery<TextMatch, ByHintTextOptions>;\n\n // a11yHint aliases\n getByA11yHint: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByA11yHint: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByA11yHint: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByA11yHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByA11yHint: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByA11yHint: FindAllByQuery<TextMatch, ByHintTextOptions>;\n\n // accessibilityHint aliases\n getByAccessibilityHint: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByAccessibilityHint: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByAccessibilityHint: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByAccessibilityHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByAccessibilityHint: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByAccessibilityHint: FindAllByQuery<TextMatch, ByHintTextOptions>;\n};\n\nexport const bindByHintTextQueries = (\n instance: ReactTestInstance\n): ByHintTextQueries => {\n const getByHintText = getBy(instance);\n const getAllByHintText = getAllBy(instance);\n const queryByHintText = queryBy(instance);\n const queryAllByHintText = queryAllBy(instance);\n const findByHintText = findBy(instance);\n const findAllByHintText = findAllBy(instance);\n\n return {\n getByHintText,\n getAllByHintText,\n queryByHintText,\n queryAllByHintText,\n findByHintText,\n findAllByHintText,\n\n // a11yHint aliases\n getByA11yHint: getByHintText,\n getAllByA11yHint: getAllByHintText,\n queryByA11yHint: queryByHintText,\n queryAllByA11yHint: queryAllByHintText,\n findByA11yHint: findByHintText,\n findAllByA11yHint: findAllByHintText,\n\n // accessibilityHint aliases\n getByAccessibilityHint: getByHintText,\n getAllByAccessibilityHint: getAllByHintText,\n queryByAccessibilityHint: queryByHintText,\n queryAllByAccessibilityHint: queryAllByHintText,\n findByAccessibilityHint: findByHintText,\n findAllByAccessibilityHint: findAllByHintText,\n };\n};\n"],"mappings":";;;;;;AACA;AACA;AACA;AAaA,MAAMA,iBAAiB,GAAG,CACxBC,IAAuB,EACvBC,IAAe,EACfC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,IAAI,EAAED,IAAI,CAACM,KAAK,CAACC,iBAAiB,EAAEH,UAAU,EAAED,KAAK,CAAC;AACvE,CAAC;AAED,MAAMK,kBAAkB,GACtBC,QAA2B,IAK3B,SAASC,oBAAoB,CAACC,IAAI,EAAEC,YAAY,EAAE;EAChD,OAAO,IAAAC,gBAAO,EACZJ,QAAQ,EACPT,IAAI,IACH,OAAOA,IAAI,CAACc,IAAI,KAAK,QAAQ,IAC7Bf,iBAAiB,CAACC,IAAI,EAAEW,IAAI,EAAEC,YAAY,CAAC,EAC7CA,YAAY,CACb;AACH,CAAC;AAEH,MAAMG,gBAAgB,GAAIJ,IAAe,IACtC,mDAAkDK,MAAM,CAACL,IAAI,CAAE,GAAE;AACpE,MAAMM,eAAe,GAAIN,IAAe,IACrC,qDAAoDK,MAAM,CAACL,IAAI,CAAE,EAAC;AAErE,MAAM;EAAEO,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7EhB,kBAAkB,EAClBS,eAAe,EACfF,gBAAgB,CACjB;AA2BM,MAAMU,qBAAqB,GAChChB,QAA2B,IACL;EACtB,MAAMiB,aAAa,GAAGR,KAAK,CAACT,QAAQ,CAAC;EACrC,MAAMkB,gBAAgB,GAAGR,QAAQ,CAACV,QAAQ,CAAC;EAC3C,MAAMmB,eAAe,GAAGR,OAAO,CAACX,QAAQ,CAAC;EACzC,MAAMD,kBAAkB,GAAGa,UAAU,CAACZ,QAAQ,CAAC;EAC/C,MAAMoB,cAAc,GAAGP,MAAM,CAACb,QAAQ,CAAC;EACvC,MAAMqB,iBAAiB,GAAGP,SAAS,CAACd,QAAQ,CAAC;EAE7C,OAAO;IACLiB,aAAa;IACbC,gBAAgB;IAChBC,eAAe;IACfpB,kBAAkB;IAClBqB,cAAc;IACdC,iBAAiB;IAEjB;IACAC,aAAa,EAAEL,aAAa;IAC5BM,gBAAgB,EAAEL,gBAAgB;IAClCM,eAAe,EAAEL,eAAe;IAChCM,kBAAkB,EAAE1B,kBAAkB;IACtC2B,cAAc,EAAEN,cAAc;IAC9BO,iBAAiB,EAAEN,iBAAiB;IAEpC;IACAO,sBAAsB,EAAEX,aAAa;IACrCY,yBAAyB,EAAEX,gBAAgB;IAC3CY,wBAAwB,EAAEX,eAAe;IACzCY,2BAA2B,EAAEhC,kBAAkB;IAC/CiC,uBAAuB,EAAEZ,cAAc;IACvCa,0BAA0B,EAAEZ;EAC9B,CAAC;AACH,CAAC;AAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
|
-
import { TextMatch } from '../matches';
|
|
2
|
+
import { TextMatch, TextMatchOptions } from '../matches';
|
|
3
3
|
import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './makeQueries';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { CommonQueryOptions } from './options';
|
|
5
|
+
type ByLabelTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
6
|
+
export type ByLabelTextQueries = {
|
|
7
|
+
getByLabelText: GetByQuery<TextMatch, ByLabelTextOptions>;
|
|
8
|
+
getAllByLabelText: GetAllByQuery<TextMatch, ByLabelTextOptions>;
|
|
9
|
+
queryByLabelText: QueryByQuery<TextMatch, ByLabelTextOptions>;
|
|
10
|
+
queryAllByLabelText: QueryAllByQuery<TextMatch, ByLabelTextOptions>;
|
|
11
|
+
findByLabelText: FindByQuery<TextMatch, ByLabelTextOptions>;
|
|
12
|
+
findAllByLabelText: FindAllByQuery<TextMatch, ByLabelTextOptions>;
|
|
12
13
|
};
|
|
13
14
|
export declare const bindByLabelTextQueries: (instance: ReactTestInstance) => ByLabelTextQueries;
|
|
15
|
+
export {};
|
|
@@ -4,18 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.bindByLabelTextQueries = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _findAll = require("../helpers/findAll");
|
|
8
|
+
var _matchLabelText = require("../helpers/matchers/matchLabelText");
|
|
8
9
|
var _makeQueries = require("./makeQueries");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return (0, _matches.matches)(text, node.props.accessibilityLabel, normalizer, exact);
|
|
15
|
-
};
|
|
16
|
-
const queryAllByLabelText = instance => function queryAllByLabelTextFn(text, queryOptions) {
|
|
17
|
-
return instance.findAll(node => typeof node.type === 'string' && getNodeByLabelText(node, text, queryOptions));
|
|
18
|
-
};
|
|
10
|
+
function queryAllByLabelText(instance) {
|
|
11
|
+
return (text, queryOptions) => {
|
|
12
|
+
return (0, _findAll.findAll)(instance, node => typeof node.type === 'string' && (0, _matchLabelText.matchLabelText)(instance, node, text, queryOptions), queryOptions);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
19
15
|
const getMultipleError = labelText => `Found multiple elements with accessibilityLabel: ${String(labelText)} `;
|
|
20
16
|
const getMissingError = labelText => `Unable to find an element with accessibilityLabel: ${String(labelText)}`;
|
|
21
17
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labelText.js","names":["
|
|
1
|
+
{"version":3,"file":"labelText.js","names":["queryAllByLabelText","instance","text","queryOptions","findAll","node","type","matchLabelText","getMultipleError","labelText","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByLabelTextQueries","getByLabelText","getAllByLabelText","queryByLabelText","findByLabelText","findAllByLabelText"],"sources":["../../src/queries/labelText.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { findAll } from '../helpers/findAll';\nimport { TextMatch, TextMatchOptions } from '../matches';\nimport { matchLabelText } from '../helpers/matchers/matchLabelText';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport { CommonQueryOptions } from './options';\n\ntype ByLabelTextOptions = CommonQueryOptions & TextMatchOptions;\n\nfunction queryAllByLabelText(instance: ReactTestInstance) {\n return (text: TextMatch, queryOptions?: ByLabelTextOptions) => {\n return findAll(\n instance,\n (node) =>\n typeof node.type === 'string' &&\n matchLabelText(instance, node, text, queryOptions),\n queryOptions\n );\n };\n}\n\nconst getMultipleError = (labelText: TextMatch) =>\n `Found multiple elements with accessibilityLabel: ${String(labelText)} `;\nconst getMissingError = (labelText: TextMatch) =>\n `Unable to find an element with accessibilityLabel: ${String(labelText)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByLabelText,\n getMissingError,\n getMultipleError\n);\n\nexport type ByLabelTextQueries = {\n getByLabelText: GetByQuery<TextMatch, ByLabelTextOptions>;\n getAllByLabelText: GetAllByQuery<TextMatch, ByLabelTextOptions>;\n queryByLabelText: QueryByQuery<TextMatch, ByLabelTextOptions>;\n queryAllByLabelText: QueryAllByQuery<TextMatch, ByLabelTextOptions>;\n findByLabelText: FindByQuery<TextMatch, ByLabelTextOptions>;\n findAllByLabelText: FindAllByQuery<TextMatch, ByLabelTextOptions>;\n};\n\nexport const bindByLabelTextQueries = (\n instance: ReactTestInstance\n): ByLabelTextQueries => ({\n getByLabelText: getBy(instance),\n getAllByLabelText: getAllBy(instance),\n queryByLabelText: queryBy(instance),\n queryAllByLabelText: queryAllBy(instance),\n findByLabelText: findBy(instance),\n findAllByLabelText: findAllBy(instance),\n});\n"],"mappings":";;;;;;AACA;AAEA;AACA;AAaA,SAASA,mBAAmB,CAACC,QAA2B,EAAE;EACxD,OAAO,CAACC,IAAe,EAAEC,YAAiC,KAAK;IAC7D,OAAO,IAAAC,gBAAO,EACZH,QAAQ,EACPI,IAAI,IACH,OAAOA,IAAI,CAACC,IAAI,KAAK,QAAQ,IAC7B,IAAAC,8BAAc,EAACN,QAAQ,EAAEI,IAAI,EAAEH,IAAI,EAAEC,YAAY,CAAC,EACpDA,YAAY,CACb;EACH,CAAC;AACH;AAEA,MAAMK,gBAAgB,GAAIC,SAAoB,IAC3C,oDAAmDC,MAAM,CAACD,SAAS,CAAE,GAAE;AAC1E,MAAME,eAAe,GAAIF,SAAoB,IAC1C,sDAAqDC,MAAM,CAACD,SAAS,CAAE,EAAC;AAE3E,MAAM;EAAEG,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7ElB,mBAAmB,EACnBW,eAAe,EACfH,gBAAgB,CACjB;AAWM,MAAMW,sBAAsB,GACjClB,QAA2B,KACH;EACxBmB,cAAc,EAAER,KAAK,CAACX,QAAQ,CAAC;EAC/BoB,iBAAiB,EAAER,QAAQ,CAACZ,QAAQ,CAAC;EACrCqB,gBAAgB,EAAER,OAAO,CAACb,QAAQ,CAAC;EACnCD,mBAAmB,EAAEe,UAAU,CAACd,QAAQ,CAAC;EACzCsB,eAAe,EAAEP,MAAM,CAACf,QAAQ,CAAC;EACjCuB,kBAAkB,EAAEP,SAAS,CAAChB,QAAQ;AACxC,CAAC,CAAC;AAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
2
|
import type { WaitForOptions } from '../waitFor';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
3
|
+
export type GetByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options) => ReactTestInstance;
|
|
4
|
+
export type GetAllByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options) => ReactTestInstance[];
|
|
5
|
+
export type QueryByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options) => ReactTestInstance | null;
|
|
6
|
+
export type QueryAllByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options) => ReactTestInstance[];
|
|
7
|
+
export type FindByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options & WaitForOptions, waitForOptions?: WaitForOptions) => Promise<ReactTestInstance>;
|
|
8
|
+
export type FindAllByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options & WaitForOptions, waitForOptions?: WaitForOptions) => Promise<ReactTestInstance[]>;
|
|
9
|
+
type UnboundQuery<Query> = (instance: ReactTestInstance) => Query;
|
|
10
|
+
export type UnboundQueries<Predicate, Options> = {
|
|
11
11
|
getBy: UnboundQuery<GetByQuery<Predicate, Options>>;
|
|
12
12
|
getAllBy: UnboundQuery<GetAllByQuery<Predicate, Options>>;
|
|
13
13
|
queryBy: UnboundQuery<QueryByQuery<Predicate, Options>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NormalizerFn } from '../matches';
|
|
2
|
+
export type CommonQueryOptions = {
|
|
3
|
+
/** Should query include elements hidden from accessibility. */
|
|
4
|
+
includeHiddenElements?: boolean;
|
|
5
|
+
/** RTL-compatibile alias to `includeHiddenElements`. */
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type TextMatchOptions = {
|
|
9
|
+
exact?: boolean;
|
|
10
|
+
normalizer?: NormalizerFn;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","names":[],"sources":["../../src/queries/options.ts"],"sourcesContent":["import { NormalizerFn } from '../matches';\n\nexport type CommonQueryOptions = {\n /** Should query include elements hidden from accessibility. */\n includeHiddenElements?: boolean;\n\n /** RTL-compatibile alias to `includeHiddenElements`. */\n hidden?: boolean;\n};\n\nexport type TextMatchOptions = {\n exact?: boolean;\n normalizer?: NormalizerFn;\n};\n"],"mappings":""}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
|
-
import { TextMatch } from '../matches';
|
|
2
|
+
import { TextMatch, TextMatchOptions } from '../matches';
|
|
3
3
|
import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './makeQueries';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import type { CommonQueryOptions } from './options';
|
|
5
|
+
type ByPlaceholderTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
6
|
+
export type ByPlaceholderTextQueries = {
|
|
7
|
+
getByPlaceholderText: GetByQuery<TextMatch, ByPlaceholderTextOptions>;
|
|
8
|
+
getAllByPlaceholderText: GetAllByQuery<TextMatch, ByPlaceholderTextOptions>;
|
|
9
|
+
queryByPlaceholderText: QueryByQuery<TextMatch, ByPlaceholderTextOptions>;
|
|
10
|
+
queryAllByPlaceholderText: QueryAllByQuery<TextMatch, ByPlaceholderTextOptions>;
|
|
11
|
+
findByPlaceholderText: FindByQuery<TextMatch, ByPlaceholderTextOptions>;
|
|
12
|
+
findAllByPlaceholderText: FindAllByQuery<TextMatch, ByPlaceholderTextOptions>;
|
|
12
13
|
};
|
|
13
14
|
export declare const bindByPlaceholderTextQueries: (instance: ReactTestInstance) => ByPlaceholderTextQueries;
|
|
15
|
+
export {};
|
|
@@ -5,18 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.bindByPlaceholderTextQueries = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
-
var
|
|
8
|
+
var _findAll = require("../helpers/findAll");
|
|
9
9
|
var _matches = require("../matches");
|
|
10
|
+
var _config = require("../config");
|
|
11
|
+
var _filterNodeByType = require("../helpers/filterNodeByType");
|
|
12
|
+
var _hostComponentNames = require("../helpers/host-component-names");
|
|
10
13
|
var _makeQueries = require("./makeQueries");
|
|
11
14
|
const getTextInputNodeByPlaceholderText = (node, placeholder, options = {}) => {
|
|
12
15
|
const {
|
|
13
16
|
exact,
|
|
14
17
|
normalizer
|
|
15
18
|
} = options;
|
|
16
|
-
|
|
19
|
+
const shouldReturnHostTextInput = (0, _config.getConfig)().useBreakingChanges;
|
|
20
|
+
const textInputType = shouldReturnHostTextInput ? (0, _hostComponentNames.getHostComponentNames)().textInput : _reactNative.TextInput;
|
|
21
|
+
return (0, _filterNodeByType.filterNodeByType)(node, textInputType) && (0, _matches.matches)(placeholder, node.props.placeholder, normalizer, exact);
|
|
17
22
|
};
|
|
18
23
|
const queryAllByPlaceholderText = instance => function queryAllByPlaceholderFn(placeholder, queryOptions) {
|
|
19
|
-
return
|
|
24
|
+
return (0, _findAll.findAll)(instance, node => getTextInputNodeByPlaceholderText(node, placeholder, queryOptions), queryOptions);
|
|
20
25
|
};
|
|
21
26
|
const getMultipleError = placeholder => `Found multiple elements with placeholder: ${String(placeholder)} `;
|
|
22
27
|
const getMissingError = placeholder => `Unable to find an element with placeholder: ${String(placeholder)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholderText.js","names":["getTextInputNodeByPlaceholderText","node","placeholder","options","exact","normalizer","
|
|
1
|
+
{"version":3,"file":"placeholderText.js","names":["getTextInputNodeByPlaceholderText","node","placeholder","options","exact","normalizer","shouldReturnHostTextInput","getConfig","useBreakingChanges","textInputType","getHostComponentNames","textInput","TextInput","filterNodeByType","matches","props","queryAllByPlaceholderText","instance","queryAllByPlaceholderFn","queryOptions","findAll","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByPlaceholderTextQueries","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText"],"sources":["../../src/queries/placeholderText.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { TextInput } from 'react-native';\nimport { findAll } from '../helpers/findAll';\nimport { matches, TextMatch, TextMatchOptions } from '../matches';\nimport { getConfig } from '../config';\nimport { filterNodeByType } from '../helpers/filterNodeByType';\nimport { getHostComponentNames } from '../helpers/host-component-names';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByPlaceholderTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst getTextInputNodeByPlaceholderText = (\n node: ReactTestInstance,\n placeholder: TextMatch,\n options: TextMatchOptions = {}\n) => {\n const { exact, normalizer } = options;\n const shouldReturnHostTextInput = getConfig().useBreakingChanges;\n const textInputType = shouldReturnHostTextInput\n ? getHostComponentNames().textInput\n : TextInput;\n\n return (\n filterNodeByType(node, textInputType) &&\n matches(placeholder, node.props.placeholder, normalizer, exact)\n );\n};\n\nconst queryAllByPlaceholderText = (\n instance: ReactTestInstance\n): ((\n placeholder: TextMatch,\n queryOptions?: ByPlaceholderTextOptions\n) => Array<ReactTestInstance>) =>\n function queryAllByPlaceholderFn(placeholder, queryOptions) {\n return findAll(\n instance,\n (node) =>\n getTextInputNodeByPlaceholderText(node, placeholder, queryOptions),\n queryOptions\n );\n };\n\nconst getMultipleError = (placeholder: TextMatch) =>\n `Found multiple elements with placeholder: ${String(placeholder)} `;\nconst getMissingError = (placeholder: TextMatch) =>\n `Unable to find an element with placeholder: ${String(placeholder)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByPlaceholderText,\n getMissingError,\n getMultipleError\n);\n\nexport type ByPlaceholderTextQueries = {\n getByPlaceholderText: GetByQuery<TextMatch, ByPlaceholderTextOptions>;\n getAllByPlaceholderText: GetAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n queryByPlaceholderText: QueryByQuery<TextMatch, ByPlaceholderTextOptions>;\n queryAllByPlaceholderText: QueryAllByQuery<\n TextMatch,\n ByPlaceholderTextOptions\n >;\n findByPlaceholderText: FindByQuery<TextMatch, ByPlaceholderTextOptions>;\n findAllByPlaceholderText: FindAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n};\n\nexport const bindByPlaceholderTextQueries = (\n instance: ReactTestInstance\n): ByPlaceholderTextQueries => ({\n getByPlaceholderText: getBy(instance),\n getAllByPlaceholderText: getAllBy(instance),\n queryByPlaceholderText: queryBy(instance),\n queryAllByPlaceholderText: queryAllBy(instance),\n findByPlaceholderText: findBy(instance),\n findAllByPlaceholderText: findAllBy(instance),\n});\n"],"mappings":";;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA,MAAMA,iCAAiC,GAAG,CACxCC,IAAuB,EACvBC,WAAsB,EACtBC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,MAAMG,yBAAyB,GAAG,IAAAC,iBAAS,GAAE,CAACC,kBAAkB;EAChE,MAAMC,aAAa,GAAGH,yBAAyB,GAC3C,IAAAI,yCAAqB,GAAE,CAACC,SAAS,GACjCC,sBAAS;EAEb,OACE,IAAAC,kCAAgB,EAACZ,IAAI,EAAEQ,aAAa,CAAC,IACrC,IAAAK,gBAAO,EAACZ,WAAW,EAAED,IAAI,CAACc,KAAK,CAACb,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AAEnE,CAAC;AAED,MAAMY,yBAAyB,GAC7BC,QAA2B,IAK3B,SAASC,uBAAuB,CAAChB,WAAW,EAAEiB,YAAY,EAAE;EAC1D,OAAO,IAAAC,gBAAO,EACZH,QAAQ,EACPhB,IAAI,IACHD,iCAAiC,CAACC,IAAI,EAAEC,WAAW,EAAEiB,YAAY,CAAC,EACpEA,YAAY,CACb;AACH,CAAC;AAEH,MAAME,gBAAgB,GAAInB,WAAsB,IAC7C,6CAA4CoB,MAAM,CAACpB,WAAW,CAAE,GAAE;AACrE,MAAMqB,eAAe,GAAIrB,WAAsB,IAC5C,+CAA8CoB,MAAM,CAACpB,WAAW,CAAE,EAAC;AAEtE,MAAM;EAAEsB,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ed,yBAAyB,EACzBO,eAAe,EACfF,gBAAgB,CACjB;AAcM,MAAMU,4BAA4B,GACvCd,QAA2B,KACG;EAC9Be,oBAAoB,EAAER,KAAK,CAACP,QAAQ,CAAC;EACrCgB,uBAAuB,EAAER,QAAQ,CAACR,QAAQ,CAAC;EAC3CiB,sBAAsB,EAAER,OAAO,CAACT,QAAQ,CAAC;EACzCD,yBAAyB,EAAEW,UAAU,CAACV,QAAQ,CAAC;EAC/CkB,qBAAqB,EAAEP,MAAM,CAACX,QAAQ,CAAC;EACvCmB,wBAAwB,EAAEP,SAAS,CAACZ,QAAQ;AAC9C,CAAC,CAAC;AAAC"}
|
package/build/queries/role.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AccessibilityState } from 'react-native';
|
|
2
2
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
3
|
+
import { AccessibilityValueMatcher } from '../helpers/matchers/accessibilityValue';
|
|
3
4
|
import type { TextMatch } from '../matches';
|
|
4
5
|
import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './makeQueries';
|
|
5
|
-
|
|
6
|
+
import { CommonQueryOptions } from './options';
|
|
7
|
+
type ByRoleOptions = CommonQueryOptions & AccessibilityState & {
|
|
6
8
|
name?: TextMatch;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
value?: AccessibilityValueMatcher;
|
|
10
|
+
};
|
|
11
|
+
export type ByRoleQueries = {
|
|
9
12
|
getByRole: GetByQuery<TextMatch, ByRoleOptions>;
|
|
10
13
|
getAllByRole: GetAllByQuery<TextMatch, ByRoleOptions>;
|
|
11
14
|
queryByRole: QueryByQuery<TextMatch, ByRoleOptions>;
|