@testing-library/react-native 11.0.0-rc.0 → 11.1.0
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.js.map +1 -1
- package/build/cleanup.js.map +1 -1
- package/build/fireEvent.js +14 -2
- package/build/fireEvent.js.map +1 -1
- package/build/flushMicroTasks.js.map +1 -1
- package/build/helpers/debugDeep.js.map +1 -1
- package/build/helpers/debugShallow.js.map +1 -1
- package/build/helpers/errors.d.ts +2 -2
- package/build/helpers/errors.js.map +1 -1
- package/build/helpers/filterNodeByType.d.ts +1 -1
- package/build/helpers/filterNodeByType.js.map +1 -1
- package/build/helpers/format.js.map +1 -1
- package/build/helpers/matchers/matchArrayProp.js.map +1 -1
- package/build/helpers/matchers/matchObjectProp.js.map +1 -1
- package/build/helpers/matchers/matchStringProp.js.map +1 -1
- package/build/helpers/timers.js.map +1 -1
- package/build/index.flow.js +30 -27
- package/build/index.js.map +1 -1
- package/build/matches.js.map +1 -1
- package/build/pure.d.ts +3 -3
- package/build/pure.js.map +1 -1
- package/build/queries/a11yState.js.map +1 -1
- package/build/queries/a11yValue.js.map +1 -1
- package/build/queries/displayValue.js.map +1 -1
- package/build/queries/hintText.js.map +1 -1
- package/build/queries/labelText.js.map +1 -1
- package/build/queries/makeQueries.js.map +1 -1
- package/build/queries/placeholderText.js.map +1 -1
- package/build/queries/role.js.map +1 -1
- package/build/queries/testId.js.map +1 -1
- package/build/queries/text.js.map +1 -1
- package/build/queries/unsafeProps.js.map +1 -1
- package/build/queries/unsafeType.js.map +1 -1
- package/build/render.d.ts +2 -2
- package/build/render.js.map +1 -1
- package/build/renderHook.d.ts +3 -4
- package/build/renderHook.js.map +1 -1
- package/build/screen.js.map +1 -1
- package/build/shallow.js.map +1 -1
- package/build/waitFor.js.map +1 -1
- package/build/waitForElementToBeRemoved.js.map +1 -1
- package/build/within.js.map +1 -1
- package/package.json +21 -19
- package/typings/index.flow.js +30 -27
package/README.md
CHANGED
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
[![Chat][chat-badge]][chat]
|
|
15
15
|
[![Sponsored by Callstack][callstack-badge]][callstack]
|
|
16
16
|
|
|
17
|
-
> We renamed the `react-native-testing-library` npm package to `@testing-library/react-native`, officially joining the "Testing Library" family 🎉. Read the [migration guide](https://callstack.github.io/react-native-testing-library/docs/migration-v7).
|
|
18
|
-
|
|
19
17
|
## The problem
|
|
20
18
|
|
|
21
19
|
You want to write maintainable tests for your React Native components. As a part of this goal, you want your tests to avoid including implementation details of your components and rather focus on making your tests give you the confidence for which they are intended. As part of this, you want your testbase to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.
|
|
@@ -138,12 +136,14 @@ The [public API](https://callstack.github.io/react-native-testing-library/docs/a
|
|
|
138
136
|
|
|
139
137
|
## Migration Guides
|
|
140
138
|
|
|
139
|
+
- [Migration to 11.0](https://callstack.github.io/react-native-testing-library/docs/migration-v11)
|
|
140
|
+
- [Migration to 9.0](https://callstack.github.io/react-native-testing-library/docs/migration-v9)
|
|
141
141
|
- [Migration to 7.0](https://callstack.github.io/react-native-testing-library/docs/migration-v7)
|
|
142
142
|
- [Migration to 2.0](https://callstack.github.io/react-native-testing-library/docs/migration-v2)
|
|
143
143
|
|
|
144
144
|
## Troubleshooting
|
|
145
145
|
|
|
146
|
-
- [
|
|
146
|
+
- [Troubleshooting guide](https://callstack.github.io/react-native-testing-library/docs/troubleshooting)
|
|
147
147
|
|
|
148
148
|
## Related External Resources
|
|
149
149
|
|
package/build/act.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"act.js","names":["actMock","callback","act"],"sources":["../src/act.ts"],"sourcesContent":["import { act } from 'react-test-renderer';\n\nconst actMock = (callback: () => void) => {\n callback();\n};\n\nexport default act || actMock;\n"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,OAAO,GAAIC,QAAD,IAA0B;EACxCA,QAAQ;AACT,CAFD;;eAIeC,sBAAA,IAAOF,O"}
|
package/build/cleanup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"cleanup.js","names":["cleanupQueue","Set","cleanup","clearRenderResult","forEach","fn","clear","addToCleanupQueue","add"],"sources":["../src/cleanup.ts"],"sourcesContent":["import * as React from 'react';\nimport { clearRenderResult } from './screen';\n\ntype CleanUpFunction = (nextElement?: React.ReactElement<any>) => void;\nlet cleanupQueue = new Set<CleanUpFunction>();\n\nexport default function cleanup() {\n clearRenderResult();\n cleanupQueue.forEach((fn) => fn());\n cleanupQueue.clear();\n}\n\nexport function addToCleanupQueue(fn: CleanUpFunction) {\n cleanupQueue.add(fn);\n}\n"],"mappings":";;;;;;;;AACA;;AAGA,IAAIA,YAAY,GAAG,IAAIC,GAAJ,EAAnB;;AAEe,SAASC,OAAT,GAAmB;EAChC,IAAAC,yBAAA;EACAH,YAAY,CAACI,OAAb,CAAsBC,EAAD,IAAQA,EAAE,EAA/B;EACAL,YAAY,CAACM,KAAb;AACD;;AAEM,SAASC,iBAAT,CAA2BF,EAA3B,EAAgD;EACrDL,YAAY,CAACQ,GAAb,CAAiBH,EAAjB;AACD"}
|
package/build/fireEvent.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _act = _interopRequireDefault(require("./act"));
|
|
9
9
|
|
|
10
|
+
var _filterNodeByType = require("./helpers/filterNodeByType");
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
|
|
12
14
|
const isHostElement = element => {
|
|
@@ -14,11 +16,21 @@ const isHostElement = element => {
|
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
const isTextInput = element => {
|
|
19
|
+
if (!element) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
const {
|
|
18
24
|
TextInput
|
|
19
|
-
} = require('react-native');
|
|
25
|
+
} = require('react-native'); // We have to test if the element type is either the TextInput component
|
|
26
|
+
// (which would if it is a composite component) or the string
|
|
27
|
+
// TextInput (which would be true if it is a host component)
|
|
28
|
+
// All queries but the one by testID return composite component and event
|
|
29
|
+
// if all queries returned host components, since fireEvent bubbles up
|
|
30
|
+
// it would trigger the parent prop without the composite component check
|
|
31
|
+
|
|
20
32
|
|
|
21
|
-
return element
|
|
33
|
+
return (0, _filterNodeByType.filterNodeByType)(element, TextInput) || (0, _filterNodeByType.filterNodeByType)(element, 'TextInput');
|
|
22
34
|
};
|
|
23
35
|
|
|
24
36
|
const isTouchResponder = element => {
|
package/build/fireEvent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"fireEvent.js","names":["isHostElement","element","type","isTextInput","TextInput","require","filterNodeByType","isTouchResponder","props","onStartShouldSetResponder","isPointerEventEnabled","isParent","parentCondition","pointerEvents","parent","isTouchEvent","eventName","isEventEnabled","touchResponder","editable","touchStart","touchMove","onMoveShouldSetResponder","undefined","findEventHandler","callsite","nearestTouchResponder","handler","getEventHandler","eventHandlerName","toEventHandlerName","invokeEvent","data","returnValue","act","charAt","toUpperCase","slice","pressHandler","changeTextHandler","scrollHandler","fireEvent","press","changeText","scroll"],"sources":["../src/fireEvent.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport act from './act';\nimport { filterNodeByType } from './helpers/filterNodeByType';\n\ntype EventHandler = (...args: any) => unknown;\n\nconst isHostElement = (element?: ReactTestInstance) => {\n return typeof element?.type === 'string';\n};\n\nconst isTextInput = (element?: ReactTestInstance) => {\n if (!element) {\n return false;\n }\n\n const { TextInput } = require('react-native');\n // We have to test if the element type is either the TextInput component\n // (which would if it is a composite component) or the string\n // TextInput (which would be true if it is a host component)\n // All queries but the one by testID return composite component and event\n // if all queries returned host components, since fireEvent bubbles up\n // it would trigger the parent prop without the composite component check\n return (\n filterNodeByType(element, TextInput) ||\n filterNodeByType(element, 'TextInput')\n );\n};\n\nconst isTouchResponder = (element?: ReactTestInstance) => {\n if (!isHostElement(element)) return false;\n\n return !!element?.props.onStartShouldSetResponder || isTextInput(element);\n};\n\nconst isPointerEventEnabled = (\n element?: ReactTestInstance,\n isParent?: boolean\n): boolean => {\n const parentCondition = isParent\n ? element?.props.pointerEvents === 'box-only'\n : element?.props.pointerEvents === 'box-none';\n\n if (element?.props.pointerEvents === 'none' || parentCondition) {\n return false;\n }\n\n if (!element?.parent) return true;\n\n return isPointerEventEnabled(element.parent, true);\n};\n\nconst isTouchEvent = (eventName?: string) => {\n return eventName === 'press';\n};\n\nconst isEventEnabled = (\n element?: ReactTestInstance,\n touchResponder?: ReactTestInstance,\n eventName?: string\n) => {\n if (isTextInput(element)) return element?.props.editable !== false;\n if (!isPointerEventEnabled(element) && isTouchEvent(eventName)) return false;\n\n const touchStart = touchResponder?.props.onStartShouldSetResponder?.();\n const touchMove = touchResponder?.props.onMoveShouldSetResponder?.();\n\n if (touchStart || touchMove) return true;\n\n return touchStart === undefined && touchMove === undefined;\n};\n\nconst findEventHandler = (\n element: ReactTestInstance,\n eventName: string,\n callsite?: any,\n nearestTouchResponder?: ReactTestInstance\n): EventHandler | null => {\n const touchResponder = isTouchResponder(element)\n ? element\n : nearestTouchResponder;\n\n const handler = getEventHandler(element, eventName);\n if (handler && isEventEnabled(element, touchResponder, eventName))\n return handler;\n\n if (element.parent === null || element.parent.parent === null) {\n return null;\n }\n\n return findEventHandler(element.parent, eventName, callsite, touchResponder);\n};\n\nconst getEventHandler = (\n element: ReactTestInstance,\n eventName: string\n): EventHandler | undefined => {\n const eventHandlerName = toEventHandlerName(eventName);\n if (typeof element.props[eventHandlerName] === 'function') {\n return element.props[eventHandlerName];\n }\n\n if (typeof element.props[eventName] === 'function') {\n return element.props[eventName];\n }\n\n return undefined;\n};\n\nconst invokeEvent = (\n element: ReactTestInstance,\n eventName: string,\n callsite?: any,\n ...data: Array<any>\n) => {\n const handler = findEventHandler(element, eventName, callsite);\n\n if (!handler) {\n return;\n }\n\n let returnValue;\n\n act(() => {\n returnValue = handler(...data);\n });\n\n return returnValue;\n};\n\nconst toEventHandlerName = (eventName: string) =>\n `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n\nconst pressHandler = (element: ReactTestInstance, ...data: Array<any>): void =>\n invokeEvent(element, 'press', pressHandler, ...data);\nconst changeTextHandler = (\n element: ReactTestInstance,\n ...data: Array<any>\n): void => invokeEvent(element, 'changeText', changeTextHandler, ...data);\nconst scrollHandler = (element: ReactTestInstance, ...data: Array<any>): void =>\n invokeEvent(element, 'scroll', scrollHandler, ...data);\n\nconst fireEvent = (\n element: ReactTestInstance,\n eventName: string,\n ...data: Array<any>\n): void => invokeEvent(element, eventName, fireEvent, ...data);\n\nfireEvent.press = pressHandler;\nfireEvent.changeText = changeTextHandler;\nfireEvent.scroll = scrollHandler;\n\nexport default fireEvent;\n"],"mappings":";;;;;;;AACA;;AACA;;;;AAIA,MAAMA,aAAa,GAAIC,OAAD,IAAiC;EACrD,OAAO,OAAOA,OAAO,EAAEC,IAAhB,KAAyB,QAAhC;AACD,CAFD;;AAIA,MAAMC,WAAW,GAAIF,OAAD,IAAiC;EACnD,IAAI,CAACA,OAAL,EAAc;IACZ,OAAO,KAAP;EACD;;EAED,MAAM;IAAEG;EAAF,IAAgBC,OAAO,CAAC,cAAD,CAA7B,CALmD,CAMnD;EACA;EACA;EACA;EACA;EACA;;;EACA,OACE,IAAAC,kCAAA,EAAiBL,OAAjB,EAA0BG,SAA1B,KACA,IAAAE,kCAAA,EAAiBL,OAAjB,EAA0B,WAA1B,CAFF;AAID,CAhBD;;AAkBA,MAAMM,gBAAgB,GAAIN,OAAD,IAAiC;EACxD,IAAI,CAACD,aAAa,CAACC,OAAD,CAAlB,EAA6B,OAAO,KAAP;EAE7B,OAAO,CAAC,CAACA,OAAO,EAAEO,KAAT,CAAeC,yBAAjB,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GAAGK,IAAJ,CAArB;EACD,CAFD;EAIA,OAAOC,WAAP;AACD,CAnBD;;AAqBA,MAAMH,kBAAkB,GAAId,SAAD,IACxB,KAAIA,SAAS,CAACmB,MAAV,CAAiB,CAAjB,EAAoBC,WAApB,EAAkC,GAAEpB,SAAS,CAACqB,KAAV,CAAgB,CAAhB,CAAmB,EAD9D;;AAGA,MAAMC,YAAY,GAAG,CAACrC,OAAD,EAA6B,GAAG+B,IAAhC,KACnBD,WAAW,CAAC9B,OAAD,EAAU,OAAV,EAAmBqC,YAAnB,EAAiC,GAAGN,IAApC,CADb;;AAEA,MAAMO,iBAAiB,GAAG,CACxBtC,OADwB,EAExB,GAAG+B,IAFqB,KAGfD,WAAW,CAAC9B,OAAD,EAAU,YAAV,EAAwBsC,iBAAxB,EAA2C,GAAGP,IAA9C,CAHtB;;AAIA,MAAMQ,aAAa,GAAG,CAACvC,OAAD,EAA6B,GAAG+B,IAAhC,KACpBD,WAAW,CAAC9B,OAAD,EAAU,QAAV,EAAoBuC,aAApB,EAAmC,GAAGR,IAAtC,CADb;;AAGA,MAAMS,SAAS,GAAG,CAChBxC,OADgB,EAEhBe,SAFgB,EAGhB,GAAGgB,IAHa,KAIPD,WAAW,CAAC9B,OAAD,EAAUe,SAAV,EAAqByB,SAArB,EAAgC,GAAGT,IAAnC,CAJtB;;AAMAS,SAAS,CAACC,KAAV,GAAkBJ,YAAlB;AACAG,SAAS,CAACE,UAAV,GAAuBJ,iBAAvB;AACAE,SAAS,CAACG,MAAV,GAAmBJ,aAAnB;eAEeC,S"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"flushMicroTasks.js","names":["flushMicroTasks","then","resolve","setImmediate"],"sources":["../src/flushMicroTasks.ts"],"sourcesContent":["import { setImmediate } from './helpers/timers';\n\ntype Thenable<T> = { then: (callback: () => T) => unknown };\n\nexport function flushMicroTasks<T>(): Thenable<T> {\n return {\n // using \"thenable\" instead of a Promise, because otherwise it breaks when\n // using \"modern\" fake timers\n then(resolve) {\n setImmediate(resolve);\n },\n };\n}\n"],"mappings":";;;;;;;AAAA;;AAIO,SAASA,eAAT,GAA2C;EAChD,OAAO;IACL;IACA;IACAC,IAAI,CAACC,OAAD,EAAU;MACZ,IAAAC,oBAAA,EAAaD,OAAb;IACD;;EALI,CAAP;AAOD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"debugDeep.js","names":["debugDeep","instance","message","console","log","format"],"sources":["../../src/helpers/debugDeep.ts"],"sourcesContent":["import type { ReactTestRendererJSON } from 'react-test-renderer';\nimport format from './format';\n\n/**\n * Log pretty-printed deep test component instance\n */\nexport default function debugDeep(\n instance: ReactTestRendererJSON | ReactTestRendererJSON[],\n message?: string\n) {\n if (message) {\n // eslint-disable-next-line no-console\n console.log(`${message}\\n\\n`, format(instance));\n } else {\n // eslint-disable-next-line no-console\n console.log(format(instance));\n }\n}\n"],"mappings":";;;;;;;AACA;;;;AAEA;AACA;AACA;AACe,SAASA,SAAT,CACbC,QADa,EAEbC,OAFa,EAGb;EACA,IAAIA,OAAJ,EAAa;IACX;IACAC,OAAO,CAACC,GAAR,CAAa,GAAEF,OAAQ,MAAvB,EAA8B,IAAAG,eAAA,EAAOJ,QAAP,CAA9B;EACD,CAHD,MAGO;IACL;IACAE,OAAO,CAACC,GAAR,CAAY,IAAAC,eAAA,EAAOJ,QAAP,CAAZ;EACD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"debugShallow.js","names":["debugShallow","instance","message","output","shallowInternal","console","log","format"],"sources":["../../src/helpers/debugShallow.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ReactTestInstance } from 'react-test-renderer';\nimport { shallowInternal } from '../shallow';\nimport format from './format';\n\n/**\n * Log pretty-printed shallow test component instance\n */\nexport default function debugShallow(\n instance: ReactTestInstance | React.ReactElement<any>,\n message?: string\n) {\n const { output } = shallowInternal(instance);\n\n if (message) {\n // eslint-disable-next-line no-console\n console.log(`${message}\\n\\n`, format(output));\n } else {\n // eslint-disable-next-line no-console\n console.log(format(output));\n }\n}\n"],"mappings":";;;;;;;AAEA;;AACA;;;;AAEA;AACA;AACA;AACe,SAASA,YAAT,CACbC,QADa,EAEbC,OAFa,EAGb;EACA,MAAM;IAAEC;EAAF,IAAa,IAAAC,wBAAA,EAAgBH,QAAhB,CAAnB;;EAEA,IAAIC,OAAJ,EAAa;IACX;IACAG,OAAO,CAACC,GAAR,CAAa,GAAEJ,OAAQ,MAAvB,EAA8B,IAAAK,eAAA,EAAOJ,MAAP,CAA9B;EACD,CAHD,MAGO;IACL;IACAE,OAAO,CAACC,GAAR,CAAY,IAAAC,eAAA,EAAOJ,MAAP,CAAZ;EACD;AACF"}
|
|
@@ -2,8 +2,8 @@ export declare class ErrorWithStack extends Error {
|
|
|
2
2
|
constructor(message: string | undefined, callsite: Function);
|
|
3
3
|
}
|
|
4
4
|
export declare const createLibraryNotSupportedError: (error: unknown) => Error;
|
|
5
|
-
export declare const prepareErrorMessage: (error: unknown, name?: string
|
|
6
|
-
export declare const createQueryByError: (error:
|
|
5
|
+
export declare const prepareErrorMessage: (error: unknown, name?: string, value?: unknown) => string;
|
|
6
|
+
export declare const createQueryByError: (error: unknown, callsite: Function) => null;
|
|
7
7
|
export declare function copyStackTrace(target: unknown, stackTraceSource: Error): void;
|
|
8
8
|
export declare function printDeprecationWarning(functionName: string): void;
|
|
9
9
|
export declare function throwRemovedFunctionError(functionName: string, docsRef: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"errors.js","names":["ErrorWithStack","Error","constructor","message","callsite","captureStackTrace","createLibraryNotSupportedError","error","prepareErrorMessage","name","value","errorMessage","replace","toString","prettyFormat","min","createQueryByError","includes","copyStackTrace","target","stackTraceSource","stack","warned","printDeprecationWarning","functionName","console","warn","throwRemovedFunctionError","docsRef","throwRenamedFunctionError","newFunctionName"],"sources":["../../src/helpers/errors.ts"],"sourcesContent":["import prettyFormat from 'pretty-format';\n\nexport class ErrorWithStack extends Error {\n constructor(message: string | undefined, callsite: Function) {\n super(message);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, callsite);\n }\n }\n}\n\nexport const createLibraryNotSupportedError = (error: unknown): Error =>\n new Error(\n `Currently the only supported library to search by text is \"react-native\".\\n\\n${\n error instanceof Error ? error.message : ''\n }`\n );\n\nexport const prepareErrorMessage = (\n // TS states that error caught in a catch close are of type `unknown`\n // most real cases will be `Error`, but better safe than sorry\n error: unknown,\n name?: string,\n value?: unknown\n): string => {\n let errorMessage: string;\n if (error instanceof Error) {\n // Strip info about custom predicate\n errorMessage = error.message.replace(\n / matching custom predicate[^]*/gm,\n ''\n );\n } else if (error && typeof error === 'object') {\n errorMessage = error.toString();\n } else {\n errorMessage = 'Caught unknown error';\n }\n\n if (name && value) {\n errorMessage += ` with ${name} ${prettyFormat(value, { min: true })}`;\n }\n return errorMessage;\n};\n\nexport const createQueryByError = (\n error: unknown,\n callsite: Function\n): null => {\n if (error instanceof Error) {\n if (error.message.includes('No instances found')) {\n return null;\n }\n throw new ErrorWithStack(error.message, callsite);\n }\n\n throw new ErrorWithStack(\n // generic refining of `unknown` is very hard, you cannot do `'toString' in error` or anything like that\n // Converting as any with extra safe optional chaining will do the job just as well\n `Query: caught unknown error type: ${typeof error}, value: ${(\n error as any\n )?.toString?.()}`,\n callsite\n );\n};\n\nexport function copyStackTrace(target: unknown, stackTraceSource: Error) {\n if (target instanceof Error && stackTraceSource.stack) {\n target.stack = stackTraceSource.stack.replace(\n stackTraceSource.message,\n target.message\n );\n }\n}\n\nconst warned: { [functionName: string]: boolean } = {};\n\nexport function printDeprecationWarning(functionName: string) {\n if (warned[functionName]) {\n return;\n }\n\n // eslint-disable-next-line no-console\n console.warn(`\n Deprecation Warning:\n Use of ${functionName} is not recommended and will be deleted in future versions of @testing-library/react-native.\n `);\n\n warned[functionName] = true;\n}\n\nexport function throwRemovedFunctionError(\n functionName: string,\n docsRef: string\n) {\n throw new Error(\n `\"${functionName}\" has been removed.\\n\\nPlease consult: https://callstack.github.io/react-native-testing-library/docs/${docsRef}`\n );\n}\n\nexport function throwRenamedFunctionError(\n functionName: string,\n newFunctionName: string\n) {\n throw new ErrorWithStack(\n `The \"${functionName}\" function has been renamed to \"${newFunctionName}\". Please replace all occurrences.`,\n throwRenamedFunctionError\n );\n}\n"],"mappings":";;;;;;;;;;;;AAAA;;;;AAEO,MAAMA,cAAN,SAA6BC,KAA7B,CAAmC;EACxCC,WAAW,CAACC,OAAD,EAA8BC,QAA9B,EAAkD;IAC3D,MAAMD,OAAN;;IACA,IAAIF,KAAK,CAACI,iBAAV,EAA6B;MAC3BJ,KAAK,CAACI,iBAAN,CAAwB,IAAxB,EAA8BD,QAA9B;IACD;EACF;;AANuC;;;;AASnC,MAAME,8BAA8B,GAAIC,KAAD,IAC5C,IAAIN,KAAJ,CACG,gFACCM,KAAK,YAAYN,KAAjB,GAAyBM,KAAK,CAACJ,OAA/B,GAAyC,EAC1C,EAHH,CADK;;;;AAOA,MAAMK,mBAAmB,GAAG,CAGjCD,KAHiC,EAIjCE,IAJiC,EAKjCC,KALiC,KAMtB;EACX,IAAIC,YAAJ;;EACA,IAAIJ,KAAK,YAAYN,KAArB,EAA4B;IAC1B;IACAU,YAAY,GAAGJ,KAAK,CAACJ,OAAN,CAAcS,OAAd,CACb,kCADa,EAEb,EAFa,CAAf;EAID,CAND,MAMO,IAAIL,KAAK,IAAI,OAAOA,KAAP,KAAiB,QAA9B,EAAwC;IAC7CI,YAAY,GAAGJ,KAAK,CAACM,QAAN,EAAf;EACD,CAFM,MAEA;IACLF,YAAY,GAAG,sBAAf;EACD;;EAED,IAAIF,IAAI,IAAIC,KAAZ,EAAmB;IACjBC,YAAY,IAAK,SAAQF,IAAK,IAAG,IAAAK,qBAAA,EAAaJ,KAAb,EAAoB;MAAEK,GAAG,EAAE;I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B,cAAJ,CACH,QAAOwB,YAAa,mCAAkCM,eAAgB,oCADnE,EAEJD,yBAFI,CAAN;AAID"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export declare const filterNodeByType: (node: ReactTestInstance | React.ReactElement, type: React.ElementType) => boolean;
|
|
3
|
+
export declare const filterNodeByType: (node: ReactTestInstance | React.ReactElement, type: React.ElementType | string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"filterNodeByType.js","names":["filterNodeByType","node","type"],"sources":["../../src/helpers/filterNodeByType.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport * as React from 'react';\n\nexport const filterNodeByType = (\n node: ReactTestInstance | React.ReactElement,\n type: React.ElementType | string\n) => node.type === type;\n"],"mappings":";;;;;;;AAGO,MAAMA,gBAAgB,GAAG,CAC9BC,IAD8B,EAE9BC,IAF8B,KAG3BD,IAAI,CAACC,IAAL,KAAcA,IAHZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"format.js","names":["format","input","prettyFormat","plugins","ReactTestComponent","ReactElement","highlight"],"sources":["../../src/helpers/format.ts"],"sourcesContent":["import type { ReactTestRendererJSON } from 'react-test-renderer';\nimport prettyFormat, { plugins } from 'pretty-format';\n\nconst format = (input: ReactTestRendererJSON | ReactTestRendererJSON[]) =>\n prettyFormat(input, {\n plugins: [plugins.ReactTestComponent, plugins.ReactElement],\n highlight: true,\n });\n\nexport default format;\n"],"mappings":";;;;;;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAIC,KAAD,IACb,IAAAC,qBAAA,EAAaD,KAAb,EAAoB;EAClBE,OAAO,EAAE,CAACA,qBAAA,CAAQC,kBAAT,EAA6BD,qBAAA,CAAQE,YAArC,CADS;EAElBC,SAAS,EAAE;AAFO,CAApB,CADF;;eAMeN,M"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"matchArrayProp.js","names":["matchArrayProp","prop","matcher","length","includes","every","e"],"sources":["../../../src/helpers/matchers/matchArrayProp.ts"],"sourcesContent":["/**\n * Matches whether given array prop contains the given value, or all given values.\n *\n * @param prop - The array prop to match.\n * @param matcher - The value or values to be included in the array.\n * @returns Whether the array prop contains the given value, or all given values.\n */\nexport function matchArrayProp(\n prop: Array<string> | undefined,\n matcher: string | Array<string>\n): boolean {\n if (!prop || matcher.length === 0) {\n return false;\n }\n\n if (typeof matcher === 'string') {\n return prop.includes(matcher);\n }\n\n return matcher.every((e) => prop.includes(e));\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CACLC,IADK,EAELC,OAFK,EAGI;EACT,IAAI,CAACD,IAAD,IAASC,OAAO,CAACC,MAAR,KAAmB,CAAhC,EAAmC;IACjC,OAAO,KAAP;EACD;;EAED,IAAI,OAAOD,OAAP,KAAmB,QAAvB,EAAiC;IAC/B,OAAOD,IAAI,CAACG,QAAL,CAAcF,OAAd,CAAP;EACD;;EAED,OAAOA,OAAO,CAACG,KAAR,CAAeC,CAAD,IAAOL,IAAI,CAACG,QAAL,CAAcE,CAAd,CAArB,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"matchObjectProp.js","names":["matchObjectProp","prop","matcher","Object","keys","length","every","key"],"sources":["../../../src/helpers/matchers/matchObjectProp.ts"],"sourcesContent":["/**\n * check that each key value pair of the objects match\n * BE CAREFUL it works only for 1 level deep key value pairs\n * won't work for nested objects\n */\n\n/**\n * Matches whether given object prop contains all key/value pairs.\n * @param prop - The object prop to match.\n * @param matcher - The key/value pairs to be included in the object.\n * @returns Whether the object prop contains all key/value pairs.\n */\nexport function matchObjectProp<T extends Record<string, unknown>>(\n prop: T | undefined,\n matcher: T\n): boolean {\n if (!prop || Object.keys(matcher).length === 0) {\n return false;\n }\n\n return (\n Object.keys(prop).length !== 0 &&\n Object.keys(matcher).every((key) => prop[key] === matcher[key])\n );\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,CACLC,IADK,EAELC,OAFK,EAGI;EACT,IAAI,CAACD,IAAD,IAASE,MAAM,CAACC,IAAP,CAAYF,OAAZ,EAAqBG,MAArB,KAAgC,CAA7C,EAAgD;IAC9C,OAAO,KAAP;EACD;;EAED,OACEF,MAAM,CAACC,IAAP,CAAYH,IAAZ,EAAkBI,MAAlB,KAA6B,CAA7B,IACAF,MAAM,CAACC,IAAP,CAAYF,OAAZ,EAAqBI,KAArB,CAA4BC,GAAD,IAASN,IAAI,CAACM,GAAD,CAAJ,KAAcL,OAAO,CAACK,GAAD,CAAzD,CAFF;AAID"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"matchStringProp.js","names":["matchStringProp","prop","matcher","match"],"sources":["../../../src/helpers/matchers/matchStringProp.ts"],"sourcesContent":["import { TextMatch } from '../../matches';\n\n/**\n * Matches the given string property again string or regex matcher.\n *\n * @param prop - The string prop to match.\n * @param matcher - The string or regex to match.\n * @returns - Whether the string prop matches the given string or regex.\n */\nexport function matchStringProp(\n prop: string | undefined,\n matcher: TextMatch\n): boolean {\n if (!prop) {\n return false;\n }\n\n if (typeof matcher === 'string') {\n return prop === matcher;\n }\n\n return prop.match(matcher) != null;\n}\n"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,CACLC,IADK,EAELC,OAFK,EAGI;EACT,IAAI,CAACD,IAAL,EAAW;IACT,OAAO,KAAP;EACD;;EAED,IAAI,OAAOC,OAAP,KAAmB,QAAvB,EAAiC;IAC/B,OAAOD,IAAI,KAAKC,OAAhB;EACD;;EAED,OAAOD,IAAI,CAACE,KAAL,CAAWD,OAAX,KAAuB,IAA9B;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"timers.js","names":["globalObj","window","global","runWithRealTimers","callback","fakeTimersType","getJestFakeTimersType","jest","useRealTimers","callbackReturnValue","fakeTimersConfig","getFakeTimersConfigFromType","useFakeTimers","setTimeout","_isMockFunction","clock","getRealSystemTime","type","legacyFakeTimers","jestFakeTimersAreEnabled","Boolean","setImmediatePolyfill","fn","bindTimeFunctions","clearTimeoutFn","clearTimeout","setImmediateFn","setImmediate","setTimeoutFn"],"sources":["../../src/helpers/timers.ts"],"sourcesContent":["// Most content of this file sourced directly from https://github.com/testing-library/dom-testing-library/blob/main/src/helpers.js\n/* globals jest */\nconst globalObj = typeof window === 'undefined' ? global : window;\n\ntype FakeTimersTypes = 'modern' | 'legacy';\n\n// Currently this fn only supports jest timers, but it could support other test runners in the future.\nfunction runWithRealTimers<T>(callback: () => T): T {\n const fakeTimersType = getJestFakeTimersType();\n if (fakeTimersType) {\n jest.useRealTimers();\n }\n\n const callbackReturnValue = callback();\n\n if (fakeTimersType) {\n const fakeTimersConfig = getFakeTimersConfigFromType(fakeTimersType);\n jest.useFakeTimers(fakeTimersConfig);\n }\n\n return callbackReturnValue;\n}\n\nfunction getJestFakeTimersType(): FakeTimersTypes | null {\n // istanbul ignore if\n if (\n typeof jest === 'undefined' ||\n typeof globalObj.setTimeout === 'undefined'\n ) {\n return null;\n }\n\n if (\n // @ts-expect-error jest mutates setTimeout\n typeof globalObj.setTimeout._isMockFunction !== 'undefined' &&\n // @ts-expect-error jest mutates setTimeout\n globalObj.setTimeout._isMockFunction\n ) {\n return 'legacy';\n }\n\n if (\n // @ts-expect-error jest mutates setTimeout\n typeof globalObj.setTimeout.clock !== 'undefined' &&\n typeof jest.getRealSystemTime !== 'undefined'\n ) {\n try {\n // jest.getRealSystemTime is only supported for Jest's `modern` fake timers and otherwise throws\n jest.getRealSystemTime();\n return 'modern';\n } catch {\n // not using Jest's modern fake timers\n }\n }\n\n return null;\n}\n\nfunction getFakeTimersConfigFromType(type: FakeTimersTypes) {\n return type === 'legacy'\n ? { legacyFakeTimers: true }\n : { legacyFakeTimers: false };\n}\n\nconst jestFakeTimersAreEnabled = (): boolean =>\n Boolean(getJestFakeTimersType());\n\n// we only run our tests in node, and setImmediate is supported in node.\nfunction setImmediatePolyfill(fn: Function) {\n return globalObj.setTimeout(fn, 0);\n}\n\ntype BindTimeFunctions = {\n clearTimeoutFn: typeof clearTimeout;\n setImmediateFn: typeof setImmediate;\n setTimeoutFn: typeof setTimeout;\n};\n\nfunction bindTimeFunctions(): BindTimeFunctions {\n return {\n clearTimeoutFn: globalObj.clearTimeout,\n setImmediateFn: globalObj.setImmediate || setImmediatePolyfill,\n setTimeoutFn: globalObj.setTimeout,\n };\n}\n\nconst { clearTimeoutFn, setImmediateFn, setTimeoutFn } = runWithRealTimers(\n bindTimeFunctions\n) as BindTimeFunctions;\n\nexport {\n runWithRealTimers,\n jestFakeTimersAreEnabled,\n clearTimeoutFn as clearTimeout,\n setImmediateFn as setImmediate,\n setTimeoutFn as setTimeout,\n};\n"],"mappings":";;;;;;;;AAAA;;AACA;AACA,MAAMA,SAAS,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAA3D;;AAIA;AACA,SAASE,iBAAT,CAA8BC,QAA9B,EAAoD;EAClD,MAAMC,cAAc,GAAGC,qBAAqB,EAA5C;;EACA,IAAID,cAAJ,EAAoB;IAClBE,IAAI,CAACC,aAAL;EACD;;EAED,MAAMC,mBAAmB,GAAGL,QAAQ,EAApC;;EAEA,IAAIC,cAAJ,EAAoB;IAClB,MAAMK,gBAAgB,GAAGC,2BAA2B,CAACN,cAAD,CAApD;IACAE,IAAI,CAACK,aAAL,CAAmBF,gBAAnB;EACD;;EAED,OAAOD,mBAAP;AACD;;AAED,SAASH,qBAAT,GAAyD;EACvD;EACA,IACE,OAAOC,IAAP,KAAgB,WAAhB,IACA,OAAOP,SAAS,CAACa,UAAjB,KAAgC,WAFlC,EAGE;IACA,OAAO,IAAP;EACD;;EAED,KACE;EACA,OAAOb,SAAS,CAACa,UAAV,CAAqBC,eAA5B,KAAgD,WAAhD,IACA;EACAd,SAAS,CAACa,UAAV,CAAqBC,eAJvB,EAKE;IACA,OAAO,QAAP;EACD;;EAED,KACE;EACA,OAAOd,SAAS,CAACa,UAAV,CAAqBE,KAA5B,KAAsC,WAAtC,IACA,OAAOR,IAAI,CAACS,iBAAZ,KAAkC,WAHpC,EAIE;IACA,IAAI;MACF;MACAT,IAAI,CAACS,iBAAL;MACA,OAAO,QAAP;IACD,CAJD,CAIE,MAAM,CACN;IACD;EACF;;EAED,OAAO,IAAP;AACD;;AAED,SAASL,2BAAT,CAAqCM,IAArC,EAA4D;EAC1D,OAAOA,IAAI,KAAK,QAAT,GACH;IAAEC,gBAAgB,EAAE;EAApB,CADG,GAEH;IAAEA,gBAAgB,EAAE;EAApB,CAFJ;AAGD;;AAED,MAAMC,wBAAwB,GAAG,MAC/BC,OAAO,CAACd,qBAAqB,EAAtB,CADT,C,CAGA;;;;;AACA,SAASe,oBAAT,CAA8BC,EAA9B,EAA4C;EAC1C,OAAOtB,SAAS,CAACa,UAAV,CAAqBS,EAArB,EAAyB,CAAzB,CAAP;AACD;;AAQD,SAASC,iBAAT,GAAgD;EAC9C,OAAO;IACLC,cAAc,EAAExB,SAAS,CAACyB,YADrB;IAELC,cAAc,EAAE1B,SAAS,CAAC2B,YAAV,IAA0BN,oBAFrC;IAGLO,YAAY,EAAE5B,SAAS,CAACa;EAHnB,CAAP;AAKD;;AAED,MAAM;EAAEW,cAAF;EAAkBE,cAAlB;EAAkCE;AAAlC,IAAmDzB,iBAAiB,CACxEoB,iBADwE,CAA1E"}
|
package/build/index.flow.js
CHANGED
|
@@ -68,6 +68,7 @@ type WaitForOptions = {
|
|
|
68
68
|
interval?: number,
|
|
69
69
|
onTimeout?: (error: mixed) => Error,
|
|
70
70
|
};
|
|
71
|
+
|
|
71
72
|
type WaitForFunction = <T = any>(
|
|
72
73
|
expectation: () => T,
|
|
73
74
|
options?: WaitForOptions
|
|
@@ -289,11 +290,6 @@ interface Thenable {
|
|
|
289
290
|
then: (resolve: () => any, reject?: () => any) => any;
|
|
290
291
|
}
|
|
291
292
|
|
|
292
|
-
interface RenderOptions {
|
|
293
|
-
wrapper?: React.ComponentType<any>;
|
|
294
|
-
createNodeMock?: (element: React.Element<any>) => any;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
293
|
type Debug = {
|
|
298
294
|
(message?: string): void,
|
|
299
295
|
shallow: (message?: string) => void,
|
|
@@ -307,15 +303,6 @@ type Queries = ByTextQueries &
|
|
|
307
303
|
UnsafeByPropsQueries &
|
|
308
304
|
A11yAPI;
|
|
309
305
|
|
|
310
|
-
interface RenderAPI extends Queries {
|
|
311
|
-
update(nextElement: React.Element<any>): void;
|
|
312
|
-
rerender(nextElement: React.Element<any>): void;
|
|
313
|
-
unmount(nextElement?: React.Element<any>): void;
|
|
314
|
-
toJSON(): ReactTestRendererJSON[] | ReactTestRendererJSON | null;
|
|
315
|
-
debug: Debug;
|
|
316
|
-
container: ReactTestInstance;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
306
|
type FireEventFunction = (
|
|
320
307
|
element: ReactTestInstance,
|
|
321
308
|
eventName: string,
|
|
@@ -328,24 +315,29 @@ type FireEventAPI = FireEventFunction & {
|
|
|
328
315
|
scroll: (element: ReactTestInstance, ...data: Array<any>) => any,
|
|
329
316
|
};
|
|
330
317
|
|
|
331
|
-
type RenderHookResult<Result, Props> = {
|
|
332
|
-
rerender: (props: Props) => void,
|
|
333
|
-
result: { current: Result },
|
|
334
|
-
unmount: () => void,
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
type RenderHookOptions<Props> = {
|
|
338
|
-
initialProps?: Props,
|
|
339
|
-
wrapper?: React.ComponentType<any>,
|
|
340
|
-
};
|
|
341
|
-
|
|
342
318
|
declare module '@testing-library/react-native' {
|
|
319
|
+
declare interface RenderResult extends Queries {
|
|
320
|
+
update(nextElement: React.Element<any>): void;
|
|
321
|
+
rerender(nextElement: React.Element<any>): void;
|
|
322
|
+
unmount(nextElement?: React.Element<any>): void;
|
|
323
|
+
toJSON(): ReactTestRendererJSON[] | ReactTestRendererJSON | null;
|
|
324
|
+
debug: Debug;
|
|
325
|
+
container: ReactTestInstance;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
declare type RenderAPI = RenderResult;
|
|
329
|
+
|
|
330
|
+
declare interface RenderOptions {
|
|
331
|
+
wrapper?: React.ComponentType<any>;
|
|
332
|
+
createNodeMock?: (element: React.Element<any>) => any;
|
|
333
|
+
}
|
|
334
|
+
|
|
343
335
|
declare export var render: (
|
|
344
336
|
component: React.Element<any>,
|
|
345
337
|
options?: RenderOptions
|
|
346
|
-
) =>
|
|
338
|
+
) => RenderResult;
|
|
347
339
|
|
|
348
|
-
declare export var screen:
|
|
340
|
+
declare export var screen: RenderResult;
|
|
349
341
|
|
|
350
342
|
declare export var cleanup: () => void;
|
|
351
343
|
declare export var fireEvent: FireEventAPI;
|
|
@@ -369,6 +361,17 @@ declare module '@testing-library/react-native' {
|
|
|
369
361
|
normalizerConfig?: NormalizerConfig
|
|
370
362
|
) => NormalizerFn;
|
|
371
363
|
|
|
364
|
+
declare type RenderHookResult<Result, Props> = {
|
|
365
|
+
rerender: (props: Props) => void,
|
|
366
|
+
result: { current: Result },
|
|
367
|
+
unmount: () => void,
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
declare type RenderHookOptions<Props> = {
|
|
371
|
+
initialProps?: Props,
|
|
372
|
+
wrapper?: React.ComponentType<any>,
|
|
373
|
+
};
|
|
374
|
+
|
|
372
375
|
declare type RenderHookFunction = <Result, Props>(
|
|
373
376
|
renderCallback: (props: Props) => Result,
|
|
374
377
|
options?: RenderHookOptions<Props>
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["afterEach","process","env","RNTL_SKIP_AUTO_CLEANUP","flushMicroTasks","cleanup"],"sources":["../src/index.ts"],"sourcesContent":["import { cleanup } from './pure';\nimport { flushMicroTasks } from './flushMicroTasks';\n\n// If we're running in a test runner that supports afterEach\n// then we'll automatically run cleanup afterEach test\n// this ensures that tests run in isolation from each other\n// if you don't like this then either import the `pure` module\n// or set the RNTL_SKIP_AUTO_CLEANUP env variable to 'true'.\nif (typeof afterEach === 'function' && !process.env.RNTL_SKIP_AUTO_CLEANUP) {\n // eslint-disable-next-line no-undef\n afterEach(async () => {\n await flushMicroTasks();\n cleanup();\n });\n}\n\nexport * from './pure';\n"],"mappings":";;;;;;AAAA;;AAgBA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAfA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAOA,SAAP,KAAqB,UAArB,IAAmC,CAACC,OAAO,CAACC,GAAR,CAAYC,sBAApD,EAA4E;EAC1E;EACAH,SAAS,CAAC,YAAY;IACpB,MAAM,IAAAI,gCAAA,GAAN;IACA,IAAAC,aAAA;EACD,CAHQ,CAAT;AAID"}
|
package/build/matches.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"matches.js","names":["matches","matcher","text","normalizer","getDefaultNormalizer","exact","normalizedText","normalizedMatcher","toLowerCase","includes","test","trim","collapseWhitespace","replace"],"sources":["../src/matches.ts"],"sourcesContent":["export type NormalizerFn = (textToNormalize: string) => string;\nexport type TextMatch = string | RegExp;\n\nexport function matches(\n matcher: TextMatch,\n text: string,\n normalizer: NormalizerFn = getDefaultNormalizer(),\n exact: boolean = true\n): boolean {\n if (typeof text !== 'string') {\n return false;\n }\n\n const normalizedText = normalizer(text);\n if (typeof matcher === 'string') {\n const normalizedMatcher = normalizer(matcher);\n return exact\n ? normalizedText === normalizedMatcher\n : normalizedText.toLowerCase().includes(normalizedMatcher.toLowerCase());\n } else {\n return matcher.test(normalizedText);\n }\n}\n\ntype NormalizerConfig = {\n trim?: boolean;\n collapseWhitespace?: boolean;\n};\n\nexport function getDefaultNormalizer({\n trim = true,\n collapseWhitespace = true,\n}: NormalizerConfig = {}): NormalizerFn {\n return (text: string) => {\n let normalizedText = text;\n normalizedText = trim ? normalizedText.trim() : normalizedText;\n normalizedText = collapseWhitespace\n ? normalizedText.replace(/\\s+/g, ' ')\n : normalizedText;\n return normalizedText;\n };\n}\n"],"mappings":";;;;;;;;AAGO,SAASA,OAAT,CACLC,OADK,EAELC,IAFK,EAGLC,UAAwB,GAAGC,oBAAoB,EAH1C,EAILC,KAAc,GAAG,IAJZ,EAKI;EACT,IAAI,OAAOH,IAAP,KAAgB,QAApB,EAA8B;IAC5B,OAAO,KAAP;EACD;;EAED,MAAMI,cAAc,GAAGH,UAAU,CAACD,IAAD,CAAjC;;EACA,IAAI,OAAOD,OAAP,KAAmB,QAAvB,EAAiC;IAC/B,MAAMM,iBAAiB,GAAGJ,UAAU,CAACF,OAAD,CAApC;IACA,OAAOI,KAAK,GACRC,cAAc,KAAKC,iBADX,GAERD,cAAc,CAACE,WAAf,GAA6BC,QAA7B,CAAsCF,iBAAiB,CAACC,WAAlB,EAAtC,CAFJ;EAGD,CALD,MAKO;IACL,OAAOP,OAAO,CAACS,IAAR,CAAaJ,cAAb,CAAP;EACD;AACF;;AAOM,SAASF,oBAAT,CAA8B;EACnCO,IAAI,GAAG,IAD4B;EAEnCC,kBAAkB,GAAG;AAFc,IAGf,EAHf,EAGiC;EACtC,OAAQV,IAAD,IAAkB;IACvB,IAAII,cAAc,GAAGJ,IAArB;IACAI,cAAc,GAAGK,IAAI,GAAGL,cAAc,CAACK,IAAf,EAAH,GAA2BL,cAAhD;IACAA,cAAc,GAAGM,kBAAkB,GAC/BN,cAAc,CAACO,OAAf,CAAuB,MAAvB,EAA+B,GAA/B,CAD+B,GAE/BP,cAFJ;IAGA,OAAOA,cAAP;EACD,CAPD;AAQD"}
|
package/build/pure.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import act from './act';
|
|
2
2
|
import cleanup from './cleanup';
|
|
3
3
|
import fireEvent from './fireEvent';
|
|
4
|
-
import render
|
|
4
|
+
import render from './render';
|
|
5
5
|
import waitFor from './waitFor';
|
|
6
6
|
import waitForElementToBeRemoved from './waitForElementToBeRemoved';
|
|
7
7
|
import { within, getQueriesForElement } from './within';
|
|
8
8
|
import { getDefaultNormalizer } from './matches';
|
|
9
9
|
import { renderHook } from './renderHook';
|
|
10
10
|
import { screen } from './screen';
|
|
11
|
-
export type { RenderResult };
|
|
12
|
-
export
|
|
11
|
+
export type { RenderOptions, RenderResult, RenderResult as RenderAPI, } from './render';
|
|
12
|
+
export type { RenderHookOptions, RenderHookResult } from './renderHook';
|
|
13
13
|
export { act };
|
|
14
14
|
export { cleanup };
|
|
15
15
|
export { fireEvent };
|
package/build/pure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"pure.js","names":[],"sources":["../src/pure.ts"],"sourcesContent":["import act from './act';\nimport cleanup from './cleanup';\nimport fireEvent from './fireEvent';\nimport render from './render';\nimport waitFor from './waitFor';\nimport waitForElementToBeRemoved from './waitForElementToBeRemoved';\nimport { within, getQueriesForElement } from './within';\nimport { getDefaultNormalizer } from './matches';\nimport { renderHook } from './renderHook';\nimport { screen } from './screen';\n\nexport type {\n RenderOptions,\n RenderResult,\n RenderResult as RenderAPI,\n} from './render';\nexport type { RenderHookOptions, RenderHookResult } from './renderHook';\n\nexport { act };\nexport { cleanup };\nexport { fireEvent };\nexport { render };\nexport { waitFor };\nexport { waitForElementToBeRemoved };\nexport { within, getQueriesForElement };\nexport { getDefaultNormalizer };\nexport { renderHook };\nexport { screen };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"a11yState.js","names":["queryAllByA11yState","instance","queryAllByA11yStateFn","state","findAll","node","type","matchObjectProp","props","accessibilityState","getMultipleError","JSON","stringify","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 { matchObjectProp } from '../helpers/matchers/matchObjectProp';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\n\nconst queryAllByA11yState = (\n instance: ReactTestInstance\n): ((state: AccessibilityState) => Array<ReactTestInstance>) =>\n function queryAllByA11yStateFn(state) {\n return instance.findAll(\n (node) =>\n typeof node.type === 'string' &&\n matchObjectProp(node.props.accessibilityState, state)\n );\n };\n\nconst getMultipleError = (state: AccessibilityState) =>\n `Found multiple elements with accessibilityState: ${JSON.stringify(state)}`;\nconst getMissingError = (state: AccessibilityState) =>\n `Unable to find an element with accessibilityState: ${JSON.stringify(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>;\n getAllByA11yState: GetAllByQuery<AccessibilityState>;\n queryByA11yState: QueryByQuery<AccessibilityState>;\n queryAllByA11yState: QueryAllByQuery<AccessibilityState>;\n findByA11yState: FindByQuery<AccessibilityState>;\n findAllByA11yState: FindAllByQuery<AccessibilityState>;\n\n getByAccessibilityState: GetByQuery<AccessibilityState>;\n getAllByAccessibilityState: GetAllByQuery<AccessibilityState>;\n queryByAccessibilityState: QueryByQuery<AccessibilityState>;\n queryAllByAccessibilityState: QueryAllByQuery<AccessibilityState>;\n findByAccessibilityState: FindByQuery<AccessibilityState>;\n findAllByAccessibilityState: FindAllByQuery<AccessibilityState>;\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;;AAUA,MAAMA,mBAAmB,GACvBC,QAD0B,IAG1B,SAASC,qBAAT,CAA+BC,KAA/B,EAAsC;EACpC,OAAOF,QAAQ,CAACG,OAAT,CACJC,IAAD,IACE,OAAOA,IAAI,CAACC,IAAZ,KAAqB,QAArB,IACA,IAAAC,gCAAA,EAAgBF,IAAI,CAACG,KAAL,CAAWC,kBAA3B,EAA+CN,KAA/C,CAHG,CAAP;AAKD,CATH;;AAWA,MAAMO,gBAAgB,GAAIP,KAAD,IACtB,oDAAmDQ,IAAI,CAACC,SAAL,CAAeT,KAAf,CAAsB,EAD5E;;AAEA,MAAMU,eAAe,GAAIV,KAAD,IACrB,sDAAqDQ,IAAI,CAACC,SAAL,CAAeT,KAAf,CAAsB,EAD9E;;AAGA,MAAM;EAAEW,KAAF;EAASC,QAAT;EAAmBC,OAAnB;EAA4BC,UAA5B;EAAwCC,MAAxC;EAAgDC;AAAhD,IAA8D,IAAAC,wBAAA,EAClEpB,mBADkE,EAElEa,eAFkE,EAGlEH,gBAHkE,CAApE;;AAsBO,MAAMW,sBAAsB,GACjCpB,QADoC,IAEb;EACvB,MAAMqB,cAAc,GAAGR,KAAK,CAACb,QAAD,CAA5B;EACA,MAAMsB,iBAAiB,GAAGR,QAAQ,CAACd,QAAD,CAAlC;EACA,MAAMuB,gBAAgB,GAAGR,OAAO,CAACf,QAAD,CAAhC;EACA,MAAMD,mBAAmB,GAAGiB,UAAU,CAAChB,QAAD,CAAtC;EACA,MAAMwB,eAAe,GAAGP,MAAM,CAACjB,QAAD,CAA9B;EACA,MAAMyB,kBAAkB,GAAGP,SAAS,CAAClB,QAAD,CAApC;EAEA,OAAO;IACLqB,cADK;IAELC,iBAFK;IAGLC,gBAHK;IAILxB,mBAJK;IAKLyB,eALK;IAMLC,kBANK;IAQLC,uBAAuB,EAAEL,cARpB;IASLM,0BAA0B,EAAEL,iBATvB;IAULM,yBAAyB,EAAEL,gBAVtB;IAWLM,4BAA4B,EAAE9B,mBAXzB;IAYL+B,wBAAwB,EAAEN,eAZrB;IAaLO,2BAA2B,EAAEN;EAbxB,CAAP;AAeD,CAzBM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"a11yValue.js","names":["queryAllByA11yValue","instance","queryAllByA11yValueFn","value","findAll","node","type","matchObjectProp","props","accessibilityValue","getMultipleError","JSON","stringify","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 { matchObjectProp } from '../helpers/matchers/matchObjectProp';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\n\ntype A11yValue = {\n min?: number;\n max?: number;\n now?: number;\n text?: string;\n};\n\nconst queryAllByA11yValue = (\n instance: ReactTestInstance\n): ((value: A11yValue) => Array<ReactTestInstance>) =>\n function queryAllByA11yValueFn(value) {\n return instance.findAll(\n (node) =>\n typeof node.type === 'string' &&\n matchObjectProp(node.props.accessibilityValue, value)\n );\n };\n\nconst getMultipleError = (value: A11yValue) =>\n `Found multiple elements with accessibilityValue: ${JSON.stringify(value)} `;\nconst getMissingError = (value: A11yValue) =>\n `Unable to find an element with accessibilityValue: ${JSON.stringify(value)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByA11yValue,\n getMissingError,\n getMultipleError\n);\n\nexport type ByA11yValueQueries = {\n getByA11yValue: GetByQuery<A11yValue>;\n getAllByA11yValue: GetAllByQuery<A11yValue>;\n queryByA11yValue: QueryByQuery<A11yValue>;\n queryAllByA11yValue: QueryAllByQuery<A11yValue>;\n findByA11yValue: FindByQuery<A11yValue>;\n findAllByA11yValue: FindAllByQuery<A11yValue>;\n\n getByAccessibilityValue: GetByQuery<A11yValue>;\n getAllByAccessibilityValue: GetAllByQuery<A11yValue>;\n queryByAccessibilityValue: QueryByQuery<A11yValue>;\n queryAllByAccessibilityValue: QueryAllByQuery<A11yValue>;\n findByAccessibilityValue: FindByQuery<A11yValue>;\n findAllByAccessibilityValue: FindAllByQuery<A11yValue>;\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;;AAiBA,MAAMA,mBAAmB,GACvBC,QAD0B,IAG1B,SAASC,qBAAT,CAA+BC,KAA/B,EAAsC;EACpC,OAAOF,QAAQ,CAACG,OAAT,CACJC,IAAD,IACE,OAAOA,IAAI,CAACC,IAAZ,KAAqB,QAArB,IACA,IAAAC,gCAAA,EAAgBF,IAAI,CAACG,KAAL,CAAWC,kBAA3B,EAA+CN,KAA/C,CAHG,CAAP;AAKD,CATH;;AAWA,MAAMO,gBAAgB,GAAIP,KAAD,IACtB,oDAAmDQ,IAAI,CAACC,SAAL,CAAeT,KAAf,CAAsB,GAD5E;;AAEA,MAAMU,eAAe,GAAIV,KAAD,IACrB,sDAAqDQ,IAAI,CAACC,SAAL,CAAeT,KAAf,CAAsB,EAD9E;;AAGA,MAAM;EAAEW,KAAF;EAASC,QAAT;EAAmBC,OAAnB;EAA4BC,UAA5B;EAAwCC,MAAxC;EAAgDC;AAAhD,IAA8D,IAAAC,wBAAA,EAClEpB,mBADkE,EAElEa,eAFkE,EAGlEH,gBAHkE,CAApE;;AAsBO,MAAMW,sBAAsB,GACjCpB,QADoC,IAEb;EACvB,MAAMqB,cAAc,GAAGR,KAAK,CAACb,QAAD,CAA5B;EACA,MAAMsB,iBAAiB,GAAGR,QAAQ,CAACd,QAAD,CAAlC;EACA,MAAMuB,gBAAgB,GAAGR,OAAO,CAACf,QAAD,CAAhC;EACA,MAAMD,mBAAmB,GAAGiB,UAAU,CAAChB,QAAD,CAAtC;EACA,MAAMwB,eAAe,GAAGP,MAAM,CAACjB,QAAD,CAA9B;EACA,MAAMyB,kBAAkB,GAAGP,SAAS,CAAClB,QAAD,CAApC;EAEA,OAAO;IACLqB,cADK;IAELC,iBAFK;IAGLC,gBAHK;IAILxB,mBAJK;IAKLyB,eALK;IAMLC,kBANK;IAQLC,uBAAuB,EAAEL,cARpB;IASLM,0BAA0B,EAAEL,iBATvB;IAULM,yBAAyB,EAAEL,gBAVtB;IAWLM,4BAA4B,EAAE9B,mBAXzB;IAYL+B,wBAAwB,EAAEN,eAZrB;IAaLO,2BAA2B,EAAEN;EAbxB,CAAP;AAeD,CAzBM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"displayValue.js","names":["getTextInputNodeByDisplayValue","node","value","options","TextInput","require","exact","normalizer","nodeValue","props","undefined","defaultValue","filterNodeByType","matches","error","createLibraryNotSupportedError","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 { createLibraryNotSupportedError } from '../helpers/errors';\nimport { filterNodeByType } from '../helpers/filterNodeByType';\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 type { TextMatchOptions } from './text';\n\nconst getTextInputNodeByDisplayValue = (\n node: ReactTestInstance,\n value: TextMatch,\n options: TextMatchOptions = {}\n) => {\n try {\n const { TextInput } = require('react-native');\n const { exact, normalizer } = options;\n const nodeValue =\n node.props.value !== undefined\n ? node.props.value\n : node.props.defaultValue;\n return (\n filterNodeByType(node, TextInput) &&\n matches(value, nodeValue, normalizer, exact)\n );\n } catch (error) {\n throw createLibraryNotSupportedError(error);\n }\n};\n\nconst queryAllByDisplayValue = (\n instance: ReactTestInstance\n): ((\n displayValue: TextMatch,\n queryOptions?: TextMatchOptions\n) => Array<ReactTestInstance>) =>\n function queryAllByDisplayValueFn(displayValue, queryOptions) {\n return instance.findAll((node) =>\n getTextInputNodeByDisplayValue(node, displayValue, 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, TextMatchOptions>;\n getAllByDisplayValue: GetAllByQuery<TextMatch, TextMatchOptions>;\n queryByDisplayValue: QueryByQuery<TextMatch, TextMatchOptions>;\n queryAllByDisplayValue: QueryAllByQuery<TextMatch, TextMatchOptions>;\n findByDisplayValue: FindByQuery<TextMatch, TextMatchOptions>;\n findAllByDisplayValue: FindAllByQuery<TextMatch, TextMatchOptions>;\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;;AAWA,MAAMA,8BAA8B,GAAG,CACrCC,IADqC,EAErCC,KAFqC,EAGrCC,OAAyB,GAA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;EAG3BkB,mBAAmB,EAAER,OAAO,CAACV,QAAD,CAHD;EAI3BD,sBAAsB,EAAEY,UAAU,CAACX,QAAD,CAJP;EAK3BmB,kBAAkB,EAAEP,MAAM,CAACZ,QAAD,CALC;EAM3BoB,qBAAqB,EAAEP,SAAS,CAACb,QAAD;AANL,CAFY,CAAlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"hintText.js","names":["queryAllByHintText","instance","queryAllByA11yHintFn","hint","findAll","node","type","matchStringProp","props","accessibilityHint","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 { TextMatch } from '../matches';\nimport { matchStringProp } from '../helpers/matchers/matchStringProp';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\n\nconst queryAllByHintText = (\n instance: ReactTestInstance\n): ((hint: TextMatch) => Array<ReactTestInstance>) =>\n function queryAllByA11yHintFn(hint) {\n return instance.findAll(\n (node) =>\n typeof node.type === 'string' &&\n matchStringProp(node.props.accessibilityHint, hint)\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>;\n getAllByHintText: GetAllByQuery<TextMatch>;\n queryByHintText: QueryByQuery<TextMatch>;\n queryAllByHintText: QueryAllByQuery<TextMatch>;\n findByHintText: FindByQuery<TextMatch>;\n findAllByHintText: FindAllByQuery<TextMatch>;\n\n // a11yHint aliases\n getByA11yHint: GetByQuery<TextMatch>;\n getAllByA11yHint: GetAllByQuery<TextMatch>;\n queryByA11yHint: QueryByQuery<TextMatch>;\n queryAllByA11yHint: QueryAllByQuery<TextMatch>;\n findByA11yHint: FindByQuery<TextMatch>;\n findAllByA11yHint: FindAllByQuery<TextMatch>;\n\n // accessibilityHint aliases\n getByAccessibilityHint: GetByQuery<TextMatch>;\n getAllByAccessibilityHint: GetAllByQuery<TextMatch>;\n queryByAccessibilityHint: QueryByQuery<TextMatch>;\n queryAllByAccessibilityHint: QueryAllByQuery<TextMatch>;\n findByAccessibilityHint: FindByQuery<TextMatch>;\n findAllByAccessibilityHint: FindAllByQuery<TextMatch>;\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 findA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AE7B,kBAZf;IAaL8B,cAAc,EAAEN,cAbX;IAcLO,iBAAiB,EAAEN,iBAdd;IAgBL;IACAO,sBAAsB,EAAEX,aAjBnB;IAkBLY,yBAAyB,EAAEX,gBAlBtB;IAmBLY,wBAAwB,EAAEX,eAnBrB;IAoBLY,2BAA2B,EAAEnC,kBApBxB;IAqBLoC,uBAAuB,EAAEZ,cArBpB;IAsBLa,0BAA0B,EAAEZ;EAtBvB,CAAP;AAwBD,CAlCM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"labelText.js","names":["queryAllByLabelText","instance","queryAllByLabelTextFn","text","findAll","node","type","matchStringProp","props","accessibilityLabel","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 { TextMatch } from '../matches';\nimport { matchStringProp } from '../helpers/matchers/matchStringProp';\nimport { makeQueries } from './makeQueries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './makeQueries';\n\nconst queryAllByLabelText = (\n instance: ReactTestInstance\n): ((text: TextMatch) => Array<ReactTestInstance>) =>\n function queryAllByLabelTextFn(text) {\n return instance.findAll(\n (node) =>\n typeof node.type === 'string' &&\n matchStringProp(node.props.accessibilityLabel, text)\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>;\n getAllByLabelText: GetAllByQuery<TextMatch>;\n queryByLabelText: QueryByQuery<TextMatch>;\n queryAllByLabelText: QueryAllByQuery<TextMatch>;\n findByLabelText: FindByQuery<TextMatch>;\n findAllByLabelText: FindAllByQuery<TextMatch>;\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":";;;;;;;AAEA;;AACA;;AAUA,MAAMA,mBAAmB,GACvBC,QAD0B,IAG1B,SAASC,qBAAT,CAA+BC,IAA/B,EAAqC;EACnC,OAAOF,QAAQ,CAACG,OAAT,CACJC,IAAD,IACE,OAAOA,IAAI,CAACC,IAAZ,KAAqB,QAArB,IACA,IAAAC,gCAAA,EAAgBF,IAAI,CAACG,KAAL,CAAWC,kBAA3B,EAA+CN,IAA/C,CAHG,CAAP;AAKD,CATH;;AAWA,MAAMO,gBAAgB,GAAIC,SAAD,IACtB,oDAAmDC,MAAM,CAACD,SAAD,CAAY,GADxE;;AAEA,MAAME,eAAe,GAAIF,SAAD,IACrB,sDAAqDC,MAAM,CAACD,SAAD,CAAY,EAD1E;;AAGA,MAAM;EAAEG,KAAF;EAASC,QAAT;EAAmBC,OAAnB;EAA4BC,UAA5B;EAAwCC,MAAxC;EAAgDC;AAAhD,IAA8D,IAAAC,wBAAA,EAClEpB,mBADkE,EAElEa,eAFkE,EAGlEH,gBAHkE,CAApE;;AAeO,MAAMW,sBAAsB,GACjCpB,QADoC,KAEZ;EACxBqB,cAAc,EAAER,KAAK,CAACb,QAAD,CADG;EAExBsB,iBAAiB,EAAER,QAAQ,CAACd,QAAD,CAFH;EAGxBuB,gBAAgB,EAAER,OAAO,CAACf,QAAD,CAHD;EAIxBD,mBAAmB,EAAEiB,UAAU,CAAChB,QAAD,CAJP;EAKxBwB,eAAe,EAAEP,MAAM,CAACjB,QAAD,CALC;EAMxByB,kBAAkB,EAAEP,SAAS,CAAClB,QAAD;AANL,CAFY,CAA/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"makeQueries.js","names":["makeQueries","queryAllByQuery","getMissingError","getMultipleError","getAllByQuery","instance","getAllFn","predicate","options","results","length","ErrorWithStack","queryByQuery","singleQueryFn","getByQuery","getFn","findAllByQuery","findAllFn","queryOptions","waitForOptions","waitFor","findByQuery","findFn","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy"],"sources":["../../src/queries/makeQueries.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { ErrorWithStack } from '../helpers/errors';\nimport waitFor from '../waitFor';\nimport type { WaitForOptions } from '../waitFor';\n\nexport type GetByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options\n) => ReactTestInstance;\n\nexport type GetAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options\n) => ReactTestInstance[];\n\nexport type QueryByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options\n) => ReactTestInstance | null;\n\nexport type QueryAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options\n) => ReactTestInstance[];\n\nexport type FindByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n waitForOptions?: WaitForOptions\n) => Promise<ReactTestInstance>;\n\nexport type FindAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n waitForOptions?: WaitForOptions\n) => Promise<ReactTestInstance[]>;\n\ntype UnboundQuery<Query> = (instance: ReactTestInstance) => Query;\n\nexport type UnboundQueries<Predicate, Options> = {\n getBy: UnboundQuery<GetByQuery<Predicate, Options>>;\n getAllBy: UnboundQuery<GetAllByQuery<Predicate, Options>>;\n queryBy: UnboundQuery<QueryByQuery<Predicate, Options>>;\n queryAllBy: UnboundQuery<QueryAllByQuery<Predicate, Options>>;\n findBy: UnboundQuery<FindByQuery<Predicate, Options>>;\n findAllBy: UnboundQuery<FindAllByQuery<Predicate, Options>>;\n};\n\nexport function makeQueries<Predicate, Options>(\n queryAllByQuery: UnboundQuery<QueryAllByQuery<Predicate, Options>>,\n getMissingError: (predicate: Predicate) => string,\n getMultipleError: (predicate: Predicate) => string\n): UnboundQueries<Predicate, Options> {\n function getAllByQuery(instance: ReactTestInstance) {\n return function getAllFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(instance)(predicate, options);\n\n if (results.length === 0) {\n throw new ErrorWithStack(getMissingError(predicate), getAllFn);\n }\n\n return results;\n };\n }\n\n function queryByQuery(instance: ReactTestInstance) {\n return function singleQueryFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(instance)(predicate, options);\n\n if (results.length > 1) {\n throw new ErrorWithStack(getMultipleError(predicate), singleQueryFn);\n }\n\n if (results.length === 0) {\n return null;\n }\n\n return results[0];\n };\n }\n\n function getByQuery(instance: ReactTestInstance) {\n return function getFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(instance)(predicate, options);\n\n if (results.length > 1) {\n throw new ErrorWithStack(getMultipleError(predicate), getFn);\n }\n\n if (results.length === 0) {\n throw new ErrorWithStack(getMissingError(predicate), getFn);\n }\n\n return results[0];\n };\n }\n\n function findAllByQuery(instance: ReactTestInstance) {\n return function findAllFn(\n predicate: Predicate,\n queryOptions?: Options,\n waitForOptions?: WaitForOptions\n ) {\n return waitFor(\n () => getAllByQuery(instance)(predicate, queryOptions),\n waitForOptions\n );\n };\n }\n\n function findByQuery(instance: ReactTestInstance) {\n return function findFn(\n predicate: Predicate,\n queryOptions?: Options,\n waitForOptions?: WaitForOptions\n ) {\n return waitFor(\n () => getByQuery(instance)(predicate, queryOptions),\n waitForOptions\n );\n };\n }\n\n return {\n getBy: getByQuery,\n getAllBy: getAllByQuery,\n queryBy: queryByQuery,\n queryAllBy: queryAllByQuery,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