@testing-library/react-native 12.8.1 → 13.0.0-alpha.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 +1 -5
- package/build/act.d.ts +2 -1
- package/build/act.js +14 -10
- package/build/act.js.map +1 -1
- package/build/config.d.ts +5 -20
- package/build/config.js +1 -8
- package/build/config.js.map +1 -1
- package/build/fire-event.js +1 -1
- package/build/fire-event.js.map +1 -1
- package/build/flush-micro-tasks.d.ts +0 -18
- package/build/flush-micro-tasks.js +0 -25
- package/build/flush-micro-tasks.js.map +1 -1
- package/build/helpers/accessibility.d.ts +1 -2
- package/build/helpers/accessibility.js +13 -21
- package/build/helpers/accessibility.js.map +1 -1
- package/build/helpers/component-tree.d.ts +2 -2
- package/build/helpers/component-tree.js +0 -3
- package/build/helpers/component-tree.js.map +1 -1
- package/build/helpers/{debug-deep.d.ts → debug.d.ts} +1 -1
- package/build/helpers/{debug-deep.js → debug.js} +3 -3
- package/build/helpers/debug.js.map +1 -0
- package/build/helpers/host-component-names.d.ts +6 -9
- package/build/helpers/host-component-names.js +12 -71
- package/build/helpers/host-component-names.js.map +1 -1
- package/build/helpers/matchers/match-label-text.d.ts +1 -1
- package/build/helpers/matchers/match-label-text.js +2 -13
- package/build/helpers/matchers/match-label-text.js.map +1 -1
- package/build/helpers/wrap-async.js +10 -27
- package/build/helpers/wrap-async.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.flow.js +4 -37
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/matchers/to-be-busy.js.map +1 -1
- package/build/matchers/to-be-checked.js.map +1 -1
- package/build/matchers/to-be-disabled.js.map +1 -1
- package/build/matchers/to-be-empty-element.js.map +1 -1
- package/build/matchers/to-be-expanded.js.map +1 -1
- package/build/matchers/to-be-on-the-screen.js.map +1 -1
- package/build/matchers/to-be-partially-checked.js.map +1 -1
- package/build/matchers/to-be-visible.js.map +1 -1
- package/build/matchers/to-contain-element.js.map +1 -1
- package/build/matchers/to-have-accessibility-value.js.map +1 -1
- package/build/matchers/to-have-accessible-name.js.map +1 -1
- package/build/matchers/to-have-display-value.js.map +1 -1
- package/build/matchers/to-have-style.js.map +1 -1
- package/build/matchers/to-have-text-content.js.map +1 -1
- package/build/matchers/types.js +4 -0
- package/build/matchers/utils.js.map +1 -1
- package/build/queries/label-text.js +1 -1
- package/build/queries/label-text.js.map +1 -1
- package/build/queries/options.js +4 -0
- package/build/render-hook.js +1 -2
- package/build/render-hook.js.map +1 -1
- package/build/render.d.ts +6 -60
- package/build/render.js +6 -13
- package/build/render.js.map +1 -1
- package/build/screen.js +0 -25
- package/build/screen.js.map +1 -1
- package/build/tsconfig.release.tsbuildinfo +1 -1
- package/build/within.d.ts +0 -24
- package/build/within.js +0 -4
- package/build/within.js.map +1 -1
- package/matchers.d.ts +1 -0
- package/matchers.js +2 -0
- package/package.json +22 -17
- package/typings/index.flow.js +4 -37
- package/build/helpers/debug-deep.js.map +0 -1
- package/build/helpers/debug-shallow.d.ts +0 -6
- package/build/helpers/debug-shallow.js +0 -25
- package/build/helpers/debug-shallow.js.map +0 -1
- package/build/queries/accessibility-state.d.ts +0 -19
- package/build/queries/accessibility-state.js +0 -59
- package/build/queries/accessibility-state.js.map +0 -1
- package/build/queries/accessibility-value.d.ts +0 -19
- package/build/queries/accessibility-value.js +0 -59
- package/build/queries/accessibility-value.js.map +0 -1
- package/build/shallow.d.ts +0 -8
- package/build/shallow.js +0 -24
- package/build/shallow.js.map +0 -1
- package/extend-expect.d.ts +0 -1
- package/extend-expect.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-accessibility-value.js","names":["_jestMatcherUtils","require","_accessibility","_matchAccessibilityValue","_object","_utils","toHaveAccessibilityValue","element","expectedValue","checkHostElement","receivedValue","computeAriaValue","pass","matchAccessibilityValue","message","matcher","matcherHint","isNot","stringify","formatMessage","removeUndefinedKeys"],"sources":["../../src/matchers/to-have-accessibility-value.
|
|
1
|
+
{"version":3,"file":"to-have-accessibility-value.js","names":["_jestMatcherUtils","require","_accessibility","_matchAccessibilityValue","_object","_utils","toHaveAccessibilityValue","element","expectedValue","checkHostElement","receivedValue","computeAriaValue","pass","matchAccessibilityValue","message","matcher","matcherHint","isNot","stringify","formatMessage","removeUndefinedKeys"],"sources":["../../src/matchers/to-have-accessibility-value.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { matcherHint, stringify } from 'jest-matcher-utils';\nimport { computeAriaValue } from '../helpers/accessibility';\nimport {\n AccessibilityValueMatcher,\n matchAccessibilityValue,\n} from '../helpers/matchers/match-accessibility-value';\nimport { removeUndefinedKeys } from '../helpers/object';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveAccessibilityValue(\n this: jest.MatcherContext,\n element: ReactTestInstance,\n expectedValue: AccessibilityValueMatcher,\n) {\n checkHostElement(element, toHaveAccessibilityValue, this);\n\n const receivedValue = computeAriaValue(element);\n\n return {\n pass: matchAccessibilityValue(element, expectedValue),\n message: () => {\n const matcher = matcherHint(\n `${this.isNot ? '.not' : ''}.toHaveAccessibilityValue`,\n 'element',\n stringify(expectedValue),\n );\n return formatMessage(\n matcher,\n `Expected the element ${this.isNot ? 'not to' : 'to'} have accessibility value`,\n stringify(expectedValue),\n 'Received element with accessibility value',\n stringify(removeUndefinedKeys(receivedValue)),\n );\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEO,SAASK,wBAAwBA,CAEtCC,OAA0B,EAC1BC,aAAwC,EACxC;EACA,IAAAC,uBAAgB,EAACF,OAAO,EAAED,wBAAwB,EAAE,IAAI,CAAC;EAEzD,MAAMI,aAAa,GAAG,IAAAC,+BAAgB,EAACJ,OAAO,CAAC;EAE/C,OAAO;IACLK,IAAI,EAAE,IAAAC,gDAAuB,EAACN,OAAO,EAAEC,aAAa,CAAC;IACrDM,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EACzB,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,2BAA2B,EACtD,SAAS,EACT,IAAAC,2BAAS,EAACV,aAAa,CACzB,CAAC;MACD,OAAO,IAAAW,oBAAa,EAClBJ,OAAO,EACP,wBAAwB,IAAI,CAACE,KAAK,GAAG,QAAQ,GAAG,IAAI,2BAA2B,EAC/E,IAAAC,2BAAS,EAACV,aAAa,CAAC,EACxB,2CAA2C,EAC3C,IAAAU,2BAAS,EAAC,IAAAE,2BAAmB,EAACV,aAAa,CAAC,CAC9C,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-accessible-name.js","names":["_jestMatcherUtils","require","_accessibility","_matches","_utils","toHaveAccessibleName","element","expectedName","options","checkHostElement","receivedName","computeAccessibleName","missingExpectedValue","arguments","length","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-accessible-name.
|
|
1
|
+
{"version":3,"file":"to-have-accessible-name.js","names":["_jestMatcherUtils","require","_accessibility","_matches","_utils","toHaveAccessibleName","element","expectedName","options","checkHostElement","receivedName","computeAccessibleName","missingExpectedValue","arguments","length","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-accessible-name.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { computeAccessibleName } from '../helpers/accessibility';\nimport { TextMatch, TextMatchOptions, matches } from '../matches';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveAccessibleName(\n this: jest.MatcherContext,\n element: ReactTestInstance,\n expectedName?: TextMatch,\n options?: TextMatchOptions,\n) {\n checkHostElement(element, toHaveAccessibleName, this);\n\n const receivedName = computeAccessibleName(element);\n const missingExpectedValue = arguments.length === 1;\n\n let pass = false;\n if (missingExpectedValue) {\n pass = receivedName !== '';\n } else {\n pass =\n expectedName != null\n ? matches(expectedName, receivedName, options?.normalizer, options?.exact)\n : false;\n }\n\n return {\n pass,\n message: () => {\n return [\n formatMessage(\n matcherHint(`${this.isNot ? '.not' : ''}.toHaveAccessibleName`, 'element', ''),\n `Expected element ${this.isNot ? 'not to' : 'to'} have accessible name`,\n expectedName,\n 'Received',\n receivedName,\n ),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,SAASI,oBAAoBA,CAElCC,OAA0B,EAC1BC,YAAwB,EACxBC,OAA0B,EAC1B;EACA,IAAAC,uBAAgB,EAACH,OAAO,EAAED,oBAAoB,EAAE,IAAI,CAAC;EAErD,MAAMK,YAAY,GAAG,IAAAC,oCAAqB,EAACL,OAAO,CAAC;EACnD,MAAMM,oBAAoB,GAAGC,SAAS,CAACC,MAAM,KAAK,CAAC;EAEnD,IAAIC,IAAI,GAAG,KAAK;EAChB,IAAIH,oBAAoB,EAAE;IACxBG,IAAI,GAAGL,YAAY,KAAK,EAAE;EAC5B,CAAC,MAAM;IACLK,IAAI,GACFR,YAAY,IAAI,IAAI,GAChB,IAAAS,gBAAO,EAACT,YAAY,EAAEG,YAAY,EAAEF,OAAO,EAAES,UAAU,EAAET,OAAO,EAAEU,KAAK,CAAC,GACxE,KAAK;EACb;EAEA,OAAO;IACLH,IAAI;IACJI,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,oBAAa,EACX,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,uBAAuB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC9E,oBAAoB,IAAI,CAACA,KAAK,GAAG,QAAQ,GAAG,IAAI,uBAAuB,EACvEf,YAAY,EACZ,UAAU,EACVG,YACF,CAAC,CACF,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-display-value.js","names":["_jestMatcherUtils","require","_hostComponentNames","_errors","_textInput","_matches","_utils","toHaveDisplayValue","element","expectedValue","options","checkHostElement","isHostTextInput","ErrorWithStack","type","receivedValue","getTextInputValue","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-display-value.
|
|
1
|
+
{"version":3,"file":"to-have-display-value.js","names":["_jestMatcherUtils","require","_hostComponentNames","_errors","_textInput","_matches","_utils","toHaveDisplayValue","element","expectedValue","options","checkHostElement","isHostTextInput","ErrorWithStack","type","receivedValue","getTextInputValue","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-display-value.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { getTextInputValue } from '../helpers/text-input';\nimport { TextMatch, TextMatchOptions, matches } from '../matches';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveDisplayValue(\n this: jest.MatcherContext,\n element: ReactTestInstance,\n expectedValue: TextMatch,\n options?: TextMatchOptions,\n) {\n checkHostElement(element, toHaveDisplayValue, this);\n\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `toHaveDisplayValue() works only with host \"TextInput\" elements. Passed element has type \"${element.type}\".`,\n toHaveDisplayValue,\n );\n }\n\n const receivedValue = getTextInputValue(element);\n\n return {\n pass: matches(expectedValue, receivedValue, options?.normalizer, options?.exact),\n message: () => {\n return [\n formatMessage(\n matcherHint(`${this.isNot ? '.not' : ''}.toHaveDisplayValue`, 'element', ''),\n `Expected element ${this.isNot ? 'not to' : 'to'} have display value`,\n expectedValue,\n 'Received',\n receivedValue,\n ),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEO,SAASM,kBAAkBA,CAEhCC,OAA0B,EAC1BC,aAAwB,EACxBC,OAA0B,EAC1B;EACA,IAAAC,uBAAgB,EAACH,OAAO,EAAED,kBAAkB,EAAE,IAAI,CAAC;EAEnD,IAAI,CAAC,IAAAK,mCAAe,EAACJ,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIK,sBAAc,CACtB,4FAA4FL,OAAO,CAACM,IAAI,IAAI,EAC5GP,kBACF,CAAC;EACH;EAEA,MAAMQ,aAAa,GAAG,IAAAC,4BAAiB,EAACR,OAAO,CAAC;EAEhD,OAAO;IACLS,IAAI,EAAE,IAAAC,gBAAO,EAACT,aAAa,EAAEM,aAAa,EAAEL,OAAO,EAAES,UAAU,EAAET,OAAO,EAAEU,KAAK,CAAC;IAChFC,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,oBAAa,EACX,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,qBAAqB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC5E,oBAAoB,IAAI,CAACA,KAAK,GAAG,QAAQ,GAAG,IAAI,qBAAqB,EACrEf,aAAa,EACb,UAAU,EACVM,aACF,CAAC,CACF,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-style.js","names":["_reactNative","require","_jestMatcherUtils","_utils","toHaveStyle","element","style","checkHostElement","expected","StyleSheet","flatten","received","props","pass","Object","keys","every","key","equals","message","to","isNot","matcher","matcherHint","formatMessage","formatStyles","pickReceivedStyles","expectedDiff","join","receivedNarrow","diff","result","forEach","undefined","sort","map","prop","Array","isArray","JSON","stringify"],"sources":["../../src/matchers/to-have-style.
|
|
1
|
+
{"version":3,"file":"to-have-style.js","names":["_reactNative","require","_jestMatcherUtils","_utils","toHaveStyle","element","style","checkHostElement","expected","StyleSheet","flatten","received","props","pass","Object","keys","every","key","equals","message","to","isNot","matcher","matcherHint","formatMessage","formatStyles","pickReceivedStyles","expectedDiff","join","receivedNarrow","diff","result","forEach","undefined","sort","map","prop","Array","isArray","JSON","stringify"],"sources":["../../src/matchers/to-have-style.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { ImageStyle, StyleProp, StyleSheet, TextStyle, ViewStyle } from 'react-native';\nimport { matcherHint, diff } from 'jest-matcher-utils';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport type Style = ViewStyle | TextStyle | ImageStyle;\n\ntype StyleLike = Record<string, unknown>;\n\nexport function toHaveStyle(\n this: jest.MatcherContext,\n element: ReactTestInstance,\n style: StyleProp<Style>,\n) {\n checkHostElement(element, toHaveStyle, this);\n\n const expected = (StyleSheet.flatten(style) as StyleLike) ?? {};\n const received = (StyleSheet.flatten(element.props.style) as StyleLike) ?? {};\n\n const pass = Object.keys(expected).every((key) => this.equals(expected[key], received[key]));\n\n return {\n pass,\n message: () => {\n const to = this.isNot ? 'not to' : 'to';\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toHaveStyle`, 'element', '');\n\n if (pass) {\n return formatMessage(\n matcher,\n `Expected element ${to} have style`,\n formatStyles(expected),\n 'Received',\n formatStyles(pickReceivedStyles(expected, received)),\n );\n } else {\n return [matcher, '', expectedDiff(expected, received)].join('\\n');\n }\n },\n };\n}\n\n/**\n * Generate diff between `expected` and `received` styles.\n */\nfunction expectedDiff(expected: StyleLike, received: StyleLike) {\n const receivedNarrow = pickReceivedStyles(expected, received);\n return diff(formatStyles(expected), formatStyles(receivedNarrow));\n}\n\n/**\n * Pick from `received` style only the keys present in `expected` style.\n */\nfunction pickReceivedStyles(expected: StyleLike, received: StyleLike) {\n const result: StyleLike = {};\n Object.keys(received).forEach((key) => {\n if (expected[key] !== undefined) {\n result[key] = received[key];\n }\n });\n\n return result;\n}\n\nfunction formatStyles(style: StyleLike) {\n return Object.keys(style)\n .sort()\n .map((prop) =>\n Array.isArray(style[prop])\n ? `${prop}: ${JSON.stringify(style[prop], null, 2)};`\n : `${prop}: ${style[prop]};`,\n )\n .join('\\n');\n}\n"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAMO,SAASG,WAAWA,CAEzBC,OAA0B,EAC1BC,KAAuB,EACvB;EACA,IAAAC,uBAAgB,EAACF,OAAO,EAAED,WAAW,EAAE,IAAI,CAAC;EAE5C,MAAMI,QAAQ,GAAIC,uBAAU,CAACC,OAAO,CAACJ,KAAK,CAAC,IAAkB,CAAC,CAAC;EAC/D,MAAMK,QAAQ,GAAIF,uBAAU,CAACC,OAAO,CAACL,OAAO,CAACO,KAAK,CAACN,KAAK,CAAC,IAAkB,CAAC,CAAC;EAE7E,MAAMO,IAAI,GAAGC,MAAM,CAACC,IAAI,CAACP,QAAQ,CAAC,CAACQ,KAAK,CAAEC,GAAG,IAAK,IAAI,CAACC,MAAM,CAACV,QAAQ,CAACS,GAAG,CAAC,EAAEN,QAAQ,CAACM,GAAG,CAAC,CAAC,CAAC;EAE5F,OAAO;IACLJ,IAAI;IACJM,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,QAAQ,GAAG,IAAI;MACvC,MAAMC,OAAO,GAAG,IAAAC,6BAA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CAACC,OAAO,CAAChC,KAAK,CAAC8B,IAAI,CAAC,CAAC,GACtB,GAAGA,IAAI,KAAKG,IAAI,CAACC,SAAS,CAAClC,KAAK,CAAC8B,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,GACnD,GAAGA,IAAI,KAAK9B,KAAK,CAAC8B,IAAI,CAAC,GAC7B,CAAC,CACAR,IAAI,CAAC,IAAI,CAAC;AACf","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-text-content.js","names":["_jestMatcherUtils","require","_textContent","_matches","_utils","toHaveTextContent","element","expectedText","options","checkHostElement","text","getTextContent","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-text-content.
|
|
1
|
+
{"version":3,"file":"to-have-text-content.js","names":["_jestMatcherUtils","require","_textContent","_matches","_utils","toHaveTextContent","element","expectedText","options","checkHostElement","text","getTextContent","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-text-content.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { getTextContent } from '../helpers/text-content';\nimport { TextMatch, TextMatchOptions, matches } from '../matches';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveTextContent(\n this: jest.MatcherContext,\n element: ReactTestInstance,\n expectedText: TextMatch,\n options?: TextMatchOptions,\n) {\n checkHostElement(element, toHaveTextContent, this);\n\n const text = getTextContent(element);\n\n return {\n pass: matches(expectedText, text, options?.normalizer, options?.exact),\n message: () => {\n return [\n formatMessage(\n matcherHint(`${this.isNot ? '.not' : ''}.toHaveTextContent`, 'element', ''),\n `Expected element ${this.isNot ? 'not to' : 'to'} have text content`,\n expectedText,\n 'Received',\n text,\n ),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,SAASI,iBAAiBA,CAE/BC,OAA0B,EAC1BC,YAAuB,EACvBC,OAA0B,EAC1B;EACA,IAAAC,uBAAgB,EAACH,OAAO,EAAED,iBAAiB,EAAE,IAAI,CAAC;EAElD,MAAMK,IAAI,GAAG,IAAAC,2BAAc,EAACL,OAAO,CAAC;EAEpC,OAAO;IACLM,IAAI,EAAE,IAAAC,gBAAO,EAACN,YAAY,EAAEG,IAAI,EAAEF,OAAO,EAAEM,UAAU,EAAEN,OAAO,EAAEO,KAAK,CAAC;IACtEC,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,oBAAa,EACX,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC3E,oBAAoB,IAAI,CAACA,KAAK,GAAG,QAAQ,GAAG,IAAI,oBAAoB,EACpEZ,YAAY,EACZ,UAAU,EACVG,IACF,CAAC,CACF,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
|
package/build/matchers/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_jestMatcherUtils","require","_prettyFormat","_interopRequireWildcard","_redent","_interopRequireDefault","_componentTree","_formatDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HostElementTypeError","Error","constructor","received","matcherFn","context","captureStackTrace","withType","printWithType","printReceived","message","matcherHint","isNot","name","RECEIVED_COLOR","join","checkHostElement","element","isHostElement","formatElement","children","props","childrenToDisplay","undefined","redent","prettyFormat","$$typeof","Symbol","for","type","defaultMapProps","plugins","ReactTestComponent","ReactElement","printFunctionName","printBasicPrototype","highlight","formatElementArray","elements","length","map","formatMessage","matcher","expectedLabel","expectedValue","receivedLabel","receivedValue","EXPECTED_COLOR","formatValue","value","stringify"],"sources":["../../src/matchers/utils.
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_jestMatcherUtils","require","_prettyFormat","_interopRequireWildcard","_redent","_interopRequireDefault","_componentTree","_formatDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HostElementTypeError","Error","constructor","received","matcherFn","context","captureStackTrace","withType","printWithType","printReceived","message","matcherHint","isNot","name","RECEIVED_COLOR","join","checkHostElement","element","isHostElement","formatElement","children","props","childrenToDisplay","undefined","redent","prettyFormat","$$typeof","Symbol","for","type","defaultMapProps","plugins","ReactTestComponent","ReactElement","printFunctionName","printBasicPrototype","highlight","formatElementArray","elements","length","map","formatMessage","matcher","expectedLabel","expectedValue","receivedLabel","receivedValue","EXPECTED_COLOR","formatValue","value","stringify"],"sources":["../../src/matchers/utils.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport {\n EXPECTED_COLOR,\n RECEIVED_COLOR,\n matcherHint,\n printWithType,\n printReceived,\n stringify,\n} from 'jest-matcher-utils';\nimport prettyFormat, { plugins } from 'pretty-format';\nimport redent from 'redent';\nimport { isHostElement } from '../helpers/component-tree';\nimport { defaultMapProps } from '../helpers/format-default';\n\nclass HostElementTypeError extends Error {\n constructor(received: unknown, matcherFn: jest.CustomMatcher, context: jest.MatcherContext) {\n super();\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, matcherFn);\n }\n\n let withType = '';\n try {\n withType = printWithType('Received', received, printReceived);\n /* istanbul ignore next */\n } catch {\n // Deliberately empty.\n }\n\n this.message = [\n matcherHint(`${context.isNot ? '.not' : ''}.${matcherFn.name}`, 'received', ''),\n '',\n `${RECEIVED_COLOR('received')} value must be a host element.`,\n withType,\n ].join('\\n');\n }\n}\n\n/**\n * Throws HostElementTypeError if passed element is not a host element.\n *\n * @param element ReactTestInstance to check.\n * @param matcherFn Matcher function calling the check used for formatting error.\n * @param context Jest matcher context used for formatting error.\n */\nexport function checkHostElement(\n element: ReactTestInstance | null | undefined,\n matcherFn: jest.CustomMatcher,\n context: jest.MatcherContext,\n): asserts element is ReactTestInstance {\n if (!isHostElement(element)) {\n throw new HostElementTypeError(element, matcherFn, context);\n }\n}\n\n/***\n * Format given element as a pretty-printed string.\n *\n * @param element Element to format.\n */\nexport function formatElement(element: ReactTestInstance | null) {\n if (element == null) {\n return ' null';\n }\n\n const { children, ...props } = element.props;\n const childrenToDisplay = typeof children === 'string' ? [children] : undefined;\n\n return redent(\n prettyFormat(\n {\n // This prop is needed persuade the prettyFormat that the element is\n // a ReactTestRendererJSON instance, so it is formatted as JSX.\n $$typeof: Symbol.for('react.test.json'),\n type: element.type,\n props: defaultMapProps(props),\n children: childrenToDisplay,\n },\n {\n plugins: [plugins.ReactTestComponent, plugins.ReactElement],\n printFunctionName: false,\n printBasicPrototype: false,\n highlight: true,\n },\n ),\n 2,\n );\n}\n\nexport function formatElementArray(elements: ReactTestInstance[]) {\n if (elements.length === 0) {\n return ' (no elements)';\n }\n\n return redent(elements.map(formatElement).join('\\n'), 2);\n}\n\nexport function formatMessage(\n matcher: string,\n expectedLabel: string,\n expectedValue: string | RegExp | null | undefined,\n receivedLabel: string,\n receivedValue: string | null | undefined,\n) {\n return [\n `${matcher}\\n`,\n `${expectedLabel}:\\n${EXPECTED_COLOR(redent(formatValue(expectedValue), 2))}`,\n `${receivedLabel}:\\n${RECEIVED_COLOR(redent(formatValue(receivedValue), 2))}`,\n ].join('\\n');\n}\n\nfunction formatValue(value: unknown) {\n return typeof value === 'string' ? value : stringify(value);\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAQA,IAAAC,aAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OA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K,GAAG,IAAAC,2BAAS,EAACD,KAAK,CAAC;AAC7D","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ var _matchLabelText = require("../helpers/matchers/match-label-text");
|
|
|
9
9
|
var _makeQueries = require("./make-queries");
|
|
10
10
|
function queryAllByLabelText(instance) {
|
|
11
11
|
return (text, queryOptions) => {
|
|
12
|
-
return (0, _findAll.findAll)(instance, node => (0, _matchLabelText.
|
|
12
|
+
return (0, _findAll.findAll)(instance, node => (0, _matchLabelText.matchAccessibilityLabel)(node, text, queryOptions), queryOptions);
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
const getMultipleError = labelText => `Found multiple elements with accessibility label: ${String(labelText)} `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-text.js","names":["_findAll","require","_matchLabelText","_makeQueries","queryAllByLabelText","instance","text","queryOptions","findAll","node","
|
|
1
|
+
{"version":3,"file":"label-text.js","names":["_findAll","require","_matchLabelText","_makeQueries","queryAllByLabelText","instance","text","queryOptions","findAll","node","matchAccessibilityLabel","getMultipleError","labelText","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByLabelTextQueries","getByLabelText","getAllByLabelText","queryByLabelText","findByLabelText","findAllByLabelText","exports"],"sources":["../../src/queries/label-text.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { findAll } from '../helpers/find-all';\nimport { TextMatch, TextMatchOptions } from '../matches';\nimport { matchAccessibilityLabel } from '../helpers/matchers/match-label-text';\nimport { makeQueries } from './make-queries';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\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) => matchAccessibilityLabel(node, text, queryOptions),\n queryOptions,\n );\n };\n}\n\nconst getMultipleError = (labelText: TextMatch) =>\n `Found multiple elements with accessibility label: ${String(labelText)} `;\nconst getMissingError = (labelText: TextMatch) =>\n `Unable to find an element with accessibility label: ${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 = (instance: ReactTestInstance): 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,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAaA,SAASG,mBAAmBA,CAACC,QAA2B,EAAE;EACxD,OAAO,CAACC,IAAe,EAAEC,YAAiC,KAAK;IAC7D,OAAO,IAAAC,gBAAO,EACZH,QAAQ,EACPI,IAAI,IAAK,IAAAC,uCAAuB,EAACD,IAAI,EAAEH,IAAI,EAAEC,YAAY,CAAC,EAC3DA,YACF,CAAC;EACH,CAAC;AACH;AAEA,MAAMI,gBAAgB,GAAIC,SAAoB,IAC5C,qDAAqDC,MAAM,CAACD,SAAS,CAAC,GAAG;AAC3E,MAAME,eAAe,GAAIF,SAAoB,IAC3C,uDAAuDC,MAAM,CAACD,SAAS,CAAC,EAAE;AAE5E,MAAM;EAAEG,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7EjB,mBAAmB,EACnBU,eAAe,EACfH,gBACF,CAAC;AAWM,MAAMW,sBAAsB,GAAIjB,QAA2B,KAA0B;EAC1FkB,cAAc,EAAER,KAAK,CAACV,QAAQ,CAAC;EAC/BmB,iBAAiB,EAAER,QAAQ,CAACX,QAAQ,CAAC;EACrCoB,gBAAgB,EAAER,OAAO,CAACZ,QAAQ,CAAC;EACnCD,mBAAmB,EAAEc,UAAU,CAACb,QAAQ,CAAC;EACzCqB,eAAe,EAAEP,MAAM,CAACd,QAAQ,CAAC;EACjCsB,kBAAkB,EAAEP,SAAS,CAACf,QAAQ;AACxC,CAAC,CAAC;AAACuB,OAAA,CAAAN,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
package/build/queries/options.js
CHANGED
package/build/render-hook.js
CHANGED
|
@@ -29,8 +29,7 @@ function renderHook(renderCallback, options) {
|
|
|
29
29
|
_react.default.createElement(TestComponent, {
|
|
30
30
|
renderCallbackProps: initialProps
|
|
31
31
|
}), {
|
|
32
|
-
wrapper
|
|
33
|
-
detectHostComponentNames: false
|
|
32
|
+
wrapper
|
|
34
33
|
});
|
|
35
34
|
function rerender(rerenderCallbackProps) {
|
|
36
35
|
return baseRerender(/*#__PURE__*/_react.default.createElement(TestComponent, {
|
package/build/render-hook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-hook.js","names":["_react","_interopRequireDefault","require","_render","e","__esModule","default","renderHook","renderCallback","options","initialProps","wrapper","result","React","createRef","TestComponent","renderCallbackProps","renderResult","useEffect","current","rerender","baseRerender","unmount","renderInternal","createElement","
|
|
1
|
+
{"version":3,"file":"render-hook.js","names":["_react","_interopRequireDefault","require","_render","e","__esModule","default","renderHook","renderCallback","options","initialProps","wrapper","result","React","createRef","TestComponent","renderCallbackProps","renderResult","useEffect","current","rerender","baseRerender","unmount","renderInternal","createElement","rerenderCallbackProps"],"sources":["../src/render-hook.tsx"],"sourcesContent":["import React from 'react';\nimport type { ComponentType } from 'react';\nimport { renderInternal } from './render';\n\nexport type RenderHookResult<Result, Props> = {\n rerender: (props: Props) => void;\n result: { current: Result };\n unmount: () => void;\n};\n\nexport type RenderHookOptions<Props> = {\n initialProps?: Props;\n wrapper?: ComponentType<any>;\n};\n\nexport function renderHook<Result, Props>(\n renderCallback: (props: Props) => Result,\n options?: RenderHookOptions<Props>,\n): RenderHookResult<Result, Props> {\n const initialProps = options?.initialProps;\n const wrapper = options?.wrapper;\n\n const result: React.MutableRefObject<Result | null> = React.createRef();\n\n function TestComponent({ renderCallbackProps }: { renderCallbackProps: Props }) {\n const renderResult = renderCallback(renderCallbackProps);\n\n React.useEffect(() => {\n result.current = renderResult;\n });\n\n return null;\n }\n\n const { rerender: baseRerender, unmount } = renderInternal(\n // @ts-expect-error since option can be undefined, initialProps can be undefined when it should'nt\n <TestComponent renderCallbackProps={initialProps} />,\n {\n wrapper,\n },\n );\n\n function rerender(rerenderCallbackProps: Props) {\n return baseRerender(<TestComponent renderCallbackProps={rerenderCallbackProps} />);\n }\n\n // @ts-expect-error result is ill typed because ref is initialized to null\n return { result, rerender, unmount };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAA0C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAanC,SAASG,UAAUA,CACxBC,cAAwC,EACxCC,OAAkC,EACD;EACjC,MAAMC,YAAY,GAAGD,OAAO,EAAEC,YAAY;EAC1C,MAAMC,OAAO,GAAGF,OAAO,EAAEE,OAAO;EAEhC,MAAMC,MAA6C,gBAAGC,cAAK,CAACC,SAAS,CAAC,CAAC;EAEvE,SAASC,aAAaA,CAAC;IAAEC;EAAoD,CAAC,EAAE;IAC9E,MAAMC,YAAY,GAAGT,cAAc,CAACQ,mBAAmB,CAAC;IAExDH,cAAK,CAACK,SAAS,CAAC,MAAM;MACpBN,MAAM,CAACO,OAAO,GAAGF,YAAY;IAC/B,CAAC,CAAC;IAEF,OAAO,IAAI;EACb;EAEA,MAAM;IAAEG,QAAQ,EAAEC,YAAY;IAAEC;EAAQ,CAAC,GAAG,IAAAC,sBAAc;EAAA;EACxD;EACAvB,MAAA,CAAAM,OAAA,CAAAkB,aAAA,CAACT,aAAa;IAACC,mBAAmB,EAAEN;EAAa,CAAE,CAAC,EACpD;IACEC;EACF,CACF,CAAC;EAED,SAASS,QAAQA,CAACK,qBAA4B,EAAE;IAC9C,OAAOJ,YAAY,cAACrB,MAAA,CAAAM,OAAA,CAAAkB,aAAA,CAACT,aAAa;MAACC,mBAAmB,EAAES;IAAsB,CAAE,CAAC,CAAC;EACpF;;EAEA;EACA,OAAO;IAAEb,MAAM;IAAEQ,QAAQ;IAAEE;EAAQ,CAAC;AACtC","ignoreList":[]}
|
package/build/render.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactTestInstance } from 'react-test-renderer';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { DebugOptions } from './helpers/debug
|
|
3
|
+
import { DebugOptions } from './helpers/debug';
|
|
4
4
|
export interface RenderOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating
|
|
@@ -8,10 +8,10 @@ export interface RenderOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
wrapper?: React.ComponentType<any>;
|
|
10
10
|
/**
|
|
11
|
-
* Set to `
|
|
12
|
-
* Otherwise `render` will default to
|
|
11
|
+
* Set to `false` to disable concurrent rendering.
|
|
12
|
+
* Otherwise `render` will default to concurrent rendering.
|
|
13
13
|
*/
|
|
14
|
-
concurrentRoot?: boolean
|
|
14
|
+
concurrentRoot?: boolean;
|
|
15
15
|
createNodeMock?: (element: React.ReactElement) => unknown;
|
|
16
16
|
unstable_validateStringsRenderedWithinText?: boolean;
|
|
17
17
|
}
|
|
@@ -44,30 +44,6 @@ export default function render<T>(component: React.ReactElement<T>, options?: Re
|
|
|
44
44
|
UNSAFE_getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
|
|
45
45
|
UNSAFE_queryByType: <P>(type: React.ComponentType<P>) => ReactTestInstance | null;
|
|
46
46
|
UNSAFE_queryAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
|
|
47
|
-
getByA11yValue: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
48
|
-
getAllByA11yValue: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
49
|
-
queryByA11yValue: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
50
|
-
queryAllByA11yValue: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
51
|
-
findByA11yValue: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
52
|
-
findAllByA11yValue: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
53
|
-
getByAccessibilityValue: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
54
|
-
getAllByAccessibilityValue: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
55
|
-
queryByAccessibilityValue: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
56
|
-
queryAllByAccessibilityValue: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
57
|
-
findByAccessibilityValue: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
58
|
-
findAllByAccessibilityValue: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
59
|
-
getByA11yState: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
60
|
-
getAllByA11yState: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
61
|
-
queryByA11yState: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
62
|
-
queryAllByA11yState: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
63
|
-
findByA11yState: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
64
|
-
findAllByA11yState: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
65
|
-
getByAccessibilityState: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
66
|
-
getAllByAccessibilityState: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
67
|
-
queryByAccessibilityState: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
68
|
-
queryAllByAccessibilityState: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
69
|
-
findByAccessibilityState: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
70
|
-
findAllByAccessibilityState: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
71
47
|
getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
|
|
72
48
|
getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
|
|
73
49
|
queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
|
|
@@ -123,10 +99,7 @@ export default function render<T>(component: React.ReactElement<T>, options?: Re
|
|
|
123
99
|
findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
|
|
124
100
|
findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
|
|
125
101
|
};
|
|
126
|
-
export
|
|
127
|
-
detectHostComponentNames?: boolean;
|
|
128
|
-
}
|
|
129
|
-
export declare function renderInternal<T>(component: React.ReactElement<T>, options?: RenderInternalOptions): {
|
|
102
|
+
export declare function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions): {
|
|
130
103
|
update: (component: React.ReactElement) => void;
|
|
131
104
|
unmount: () => void;
|
|
132
105
|
rerender: (component: React.ReactElement) => void;
|
|
@@ -150,30 +123,6 @@ export declare function renderInternal<T>(component: React.ReactElement<T>, opti
|
|
|
150
123
|
UNSAFE_getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
|
|
151
124
|
UNSAFE_queryByType: <P>(type: React.ComponentType<P>) => ReactTestInstance | null;
|
|
152
125
|
UNSAFE_queryAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
|
|
153
|
-
getByA11yValue: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
154
|
-
getAllByA11yValue: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
155
|
-
queryByA11yValue: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
156
|
-
queryAllByA11yValue: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
157
|
-
findByA11yValue: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
158
|
-
findAllByA11yValue: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
159
|
-
getByAccessibilityValue: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
160
|
-
getAllByAccessibilityValue: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
161
|
-
queryByAccessibilityValue: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
162
|
-
queryAllByAccessibilityValue: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
163
|
-
findByAccessibilityValue: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
164
|
-
findAllByAccessibilityValue: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-value").AccessibilityValueMatcher, import("./queries/options").CommonQueryOptions>;
|
|
165
|
-
getByA11yState: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
166
|
-
getAllByA11yState: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
167
|
-
queryByA11yState: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
168
|
-
queryAllByA11yState: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
169
|
-
findByA11yState: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
170
|
-
findAllByA11yState: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
171
|
-
getByAccessibilityState: import("./queries/make-queries").GetByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
172
|
-
getAllByAccessibilityState: import("./queries/make-queries").GetAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
173
|
-
queryByAccessibilityState: import("./queries/make-queries").QueryByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
174
|
-
queryAllByAccessibilityState: import("./queries/make-queries").QueryAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
175
|
-
findByAccessibilityState: import("./queries/make-queries").FindByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
176
|
-
findAllByAccessibilityState: import("./queries/make-queries").FindAllByQuery<import("./helpers/matchers/match-accessibility-state").AccessibilityStateMatcher, import("./queries/options").CommonQueryOptions>;
|
|
177
126
|
getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
|
|
178
127
|
getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
|
|
179
128
|
queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
|
|
@@ -229,7 +178,4 @@ export declare function renderInternal<T>(component: React.ReactElement<T>, opti
|
|
|
229
178
|
findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
|
|
230
179
|
findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
|
|
231
180
|
};
|
|
232
|
-
export
|
|
233
|
-
(options?: DebugOptions | string): void;
|
|
234
|
-
shallow: (message?: string) => void;
|
|
235
|
-
}
|
|
181
|
+
export type DebugFunction = (options?: DebugOptions | string) => void;
|
package/build/render.js
CHANGED
|
@@ -11,9 +11,7 @@ var _act = _interopRequireDefault(require("./act"));
|
|
|
11
11
|
var _cleanup = require("./cleanup");
|
|
12
12
|
var _config = require("./config");
|
|
13
13
|
var _componentTree = require("./helpers/component-tree");
|
|
14
|
-
var
|
|
15
|
-
var _debugShallow = _interopRequireDefault(require("./helpers/debug-shallow"));
|
|
16
|
-
var _hostComponentNames = require("./helpers/host-component-names");
|
|
14
|
+
var _debug = require("./helpers/debug");
|
|
17
15
|
var _stringValidation = require("./helpers/string-validation");
|
|
18
16
|
var _renderAct = require("./render-act");
|
|
19
17
|
var _screen = require("./screen");
|
|
@@ -32,7 +30,6 @@ function renderInternal(component, options) {
|
|
|
32
30
|
const {
|
|
33
31
|
wrapper: Wrapper,
|
|
34
32
|
concurrentRoot,
|
|
35
|
-
detectHostComponentNames = true,
|
|
36
33
|
unstable_validateStringsRenderedWithinText,
|
|
37
34
|
...rest
|
|
38
35
|
} = options || {};
|
|
@@ -41,9 +38,6 @@ function renderInternal(component, options) {
|
|
|
41
38
|
// @ts-expect-error incomplete typing on RTR package
|
|
42
39
|
unstable_isConcurrent: concurrentRoot ?? (0, _config.getConfig)().concurrentRoot
|
|
43
40
|
};
|
|
44
|
-
if (detectHostComponentNames) {
|
|
45
|
-
(0, _hostComponentNames.configureHostComponentNamesIfNeeded)();
|
|
46
|
-
}
|
|
47
41
|
if (unstable_validateStringsRenderedWithinText) {
|
|
48
42
|
return renderWithStringValidation(component, {
|
|
49
43
|
wrapper: Wrapper,
|
|
@@ -89,9 +83,9 @@ function buildRenderResult(renderer, wrap) {
|
|
|
89
83
|
rerender: update,
|
|
90
84
|
// alias for `update`
|
|
91
85
|
toJSON: renderer.toJSON,
|
|
92
|
-
debug:
|
|
86
|
+
debug: makeDebug(instance, renderer),
|
|
93
87
|
get root() {
|
|
94
|
-
return (0, _componentTree.
|
|
88
|
+
return (0, _componentTree.getHostSelves)(instance)[0];
|
|
95
89
|
},
|
|
96
90
|
UNSAFE_root: instance
|
|
97
91
|
};
|
|
@@ -114,7 +108,7 @@ function updateWithAct(renderer, wrap) {
|
|
|
114
108
|
});
|
|
115
109
|
};
|
|
116
110
|
}
|
|
117
|
-
function
|
|
111
|
+
function makeDebug(instance, renderer) {
|
|
118
112
|
function debugImpl(options) {
|
|
119
113
|
const {
|
|
120
114
|
defaultDebugOptions
|
|
@@ -128,14 +122,13 @@ function debug(instance, renderer) {
|
|
|
128
122
|
};
|
|
129
123
|
if (typeof options === 'string') {
|
|
130
124
|
// eslint-disable-next-line no-console
|
|
131
|
-
console.warn('Using debug("message") is deprecated and will be removed in future release, please use debug({ message
|
|
125
|
+
console.warn('Using debug("message") is deprecated and will be removed in future release, please use debug({ message: "message" }) instead.');
|
|
132
126
|
}
|
|
133
127
|
const json = renderer.toJSON();
|
|
134
128
|
if (json) {
|
|
135
|
-
return (0,
|
|
129
|
+
return (0, _debug.debug)(json, debugOptions);
|
|
136
130
|
}
|
|
137
131
|
}
|
|
138
|
-
debugImpl.shallow = message => (0, _debugShallow.default)(instance, message);
|
|
139
132
|
return debugImpl;
|
|
140
133
|
}
|
|
141
134
|
//# sourceMappingURL=render.js.map
|
package/build/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["_react","_interopRequireWildcard","require","React","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debugDeep","_debugShallow","_hostComponentNames","_stringValidation","_renderAct","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","concurrentRoot","detectHostComponentNames","unstable_validateStringsRenderedWithinText","rest","testRendererOptions","unstable_isConcurrent","getConfig","configureHostComponentNamesIfNeeded","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","handleRender","_","phase","validateStringsRenderedWithinText","toJSON","Profiler","id","onRender","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","getHostChildren","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","debugOptions","message","console","warn","json","debugDeep","shallow","debugShallow"],"sources":["../src/render.tsx"],"sourcesContent":["import type {\n ReactTestInstance,\n ReactTestRenderer,\n TestRendererOptions,\n} from 'react-test-renderer';\nimport * as React from 'react';\nimport { Profiler } from 'react';\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostChildren } from './helpers/component-tree';\nimport debugDeep, { DebugOptions } from './helpers/debug-deep';\nimport debugShallow from './helpers/debug-shallow';\nimport { configureHostComponentNamesIfNeeded } from './helpers/host-component-names';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `true` to enable concurrent rendering.\n * Otherwise `render` will default to legacy synchronous rendering.\n */\n concurrentRoot?: boolean | undefined;\n\n createNodeMock?: (element: React.ReactElement) => unknown;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport interface RenderInternalOptions extends RenderOptions {\n detectHostComponentNames?: boolean;\n}\n\nexport function renderInternal<T>(\n component: React.ReactElement<T>,\n options?: RenderInternalOptions,\n) {\n const {\n wrapper: Wrapper,\n concurrentRoot,\n detectHostComponentNames = true,\n unstable_validateStringsRenderedWithinText,\n ...rest\n } = options || {};\n\n const testRendererOptions: TestRendererOptions = {\n ...rest,\n // @ts-expect-error incomplete typing on RTR package\n unstable_isConcurrent: concurrentRoot ?? getConfig().concurrentRoot,\n };\n\n if (detectHostComponentNames) {\n configureHostComponentNamesIfNeeded();\n }\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n ...testRendererOptions,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n options: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n let renderer: ReactTestRenderer;\n const { wrapper: Wrapper, ...testRendererOptions } = options ?? {};\n\n const handleRender: React.ProfilerOnRenderCallback = (_, phase) => {\n if (renderer && phase === 'update') {\n validateStringsRenderedWithinText(renderer.toJSON());\n }\n };\n\n const wrap = (element: React.ReactElement) => (\n <Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </Profiler>\n );\n\n renderer = renderWithAct(wrap(component), testRendererOptions);\n\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: debug(instance, renderer),\n get root(): ReactTestInstance {\n return getHostChildren(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport interface DebugFunction {\n (options?: DebugOptions | string): void;\n shallow: (message?: string) => void;\n}\n\nfunction debug(instance: ReactTestInstance, renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions | string) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions =\n typeof options === 'string'\n ? { ...defaultDebugOptions, message: options }\n : { ...defaultDebugOptions, ...options };\n\n if (typeof options === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Using debug(\"message\") is deprecated and will be removed in future release, please use debug({ message; \"message\" }) instead.',\n );\n }\n\n const json = renderer.toJSON();\n if (json) {\n return debugDeep(json, debugOptions);\n }\n }\n debugImpl.shallow = (message?: string) => debugShallow(instance, message);\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,aAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAA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AAS;AAClB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"render.js","names":["_react","_interopRequireWildcard","require","React","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debug","_stringValidation","_renderAct","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","concurrentRoot","unstable_validateStringsRenderedWithinText","rest","testRendererOptions","unstable_isConcurrent","getConfig","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","handleRender","_","phase","validateStringsRenderedWithinText","toJSON","Profiler","id","onRender","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","makeDebug","getHostSelves","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","debugOptions","message","console","warn","json"],"sources":["../src/render.tsx"],"sourcesContent":["import type {\n ReactTestInstance,\n ReactTestRenderer,\n TestRendererOptions,\n} from 'react-test-renderer';\nimport * as React from 'react';\nimport { Profiler } from 'react';\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostSelves } from './helpers/component-tree';\nimport { debug, DebugOptions } from './helpers/debug';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `render` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n\n createNodeMock?: (element: React.ReactElement) => unknown;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions) {\n const {\n wrapper: Wrapper,\n concurrentRoot,\n unstable_validateStringsRenderedWithinText,\n ...rest\n } = options || {};\n\n const testRendererOptions: TestRendererOptions = {\n ...rest,\n // @ts-expect-error incomplete typing on RTR package\n unstable_isConcurrent: concurrentRoot ?? getConfig().concurrentRoot,\n };\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n ...testRendererOptions,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n options: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n let renderer: ReactTestRenderer;\n const { wrapper: Wrapper, ...testRendererOptions } = options ?? {};\n\n const handleRender: React.ProfilerOnRenderCallback = (_, phase) => {\n if (renderer && phase === 'update') {\n validateStringsRenderedWithinText(renderer.toJSON());\n }\n };\n\n const wrap = (element: React.ReactElement) => (\n <Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </Profiler>\n );\n\n renderer = renderWithAct(wrap(component), testRendererOptions);\n\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: makeDebug(instance, renderer),\n get root(): ReactTestInstance {\n return getHostSelves(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport type DebugFunction = (options?: DebugOptions | string) => void;\n\nfunction makeDebug(instance: ReactTestInstance, renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions | string) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions =\n typeof options === 'string'\n ? { ...defaultDebugOptions, message: options }\n : { ...defaultDebugOptions, ...options };\n\n if (typeof options === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Using debug(\"message\") is deprecated and will be removed in future release, please use debug({ message: \"message\" }) instead.',\n );\n }\n\n const json = renderer.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAAgD,SAAAG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AAK;IACjBrD,GAAGA,CAAA,EAAG;MACJ,MAAM,IAAIsD,KAAK,CACb,6DAA6D,GAC3D,iEACJ,CAAC;IACH;EACF,CAAC,CAAC;EAEF,IAAAC,uBAAe,EAACT,MAAM,CAAC;EAEvB,OAAOA,MAAM;AACf;AAEA,SAASN,aAAaA,CACpBZ,QAA2B,EAC3BH,IAA8D,EAC9D;EACA,OAAO,UAAUZ,SAA6B,EAAE;IAC9C,KAAK,IAAA+B,YAAG,EAAC,MAAM;MACbhB,QAAQ,CAACW,MAAM,CAACd,IAAI,CAACZ,SAAS,CAAC,CAAC;IAClC,CAAC,CAAC;EACJ,CAAC;AACH;AAIA,SAASqC,SAASA,CAACT,QAA2B,EAAEb,QAA2B,EAAiB;EAC1F,SAAS4B,SAASA,CAAC1C,OAA+B,EAAE;IAClD,MAAM;MAAE2C;IAAoB,CAAC,GAAG,IAAAlC,iBAAS,EAAC,CAAC;IAC3C,MAAMmC,YAAY,GAChB,OAAO5C,OAAO,KAAK,QAAQ,GACvB;MAAE,GAAG2C,mBAAmB;MAAEE,OAAO,EAAE7C;IAAQ,CAAC,GAC5C;MAAE,GAAG2C,mBAAmB;MAAE,GAAG3C;IAAQ,CAAC;IAE5C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B;MACA8C,OAAO,CAACC,IAAI,CACV,+HACF,CAAC;IACH;IAEA,MAAMC,IAAI,GAAGlC,QAAQ,CAACO,MAAM,CAAC,CAAC;IAC9B,IAAI2B,IAAI,EAAE;MACR,OAAO,IAAAb,YAAK,EAACa,IAAI,EAAEJ,YAAY,CAAC;IAClC;EACF;EACA,OAAOF,SAAS;AAClB","ignoreList":[]}
|
package/build/screen.js
CHANGED
|
@@ -13,7 +13,6 @@ const notImplemented = () => {
|
|
|
13
13
|
const notImplementedDebug = () => {
|
|
14
14
|
throw new Error(SCREEN_ERROR);
|
|
15
15
|
};
|
|
16
|
-
notImplementedDebug.shallow = notImplemented;
|
|
17
16
|
const defaultScreen = {
|
|
18
17
|
isDetached: true,
|
|
19
18
|
get root() {
|
|
@@ -57,30 +56,6 @@ const defaultScreen = {
|
|
|
57
56
|
queryAllByRole: notImplemented,
|
|
58
57
|
findByRole: notImplemented,
|
|
59
58
|
findAllByRole: notImplemented,
|
|
60
|
-
getByA11yState: notImplemented,
|
|
61
|
-
getAllByA11yState: notImplemented,
|
|
62
|
-
queryByA11yState: notImplemented,
|
|
63
|
-
queryAllByA11yState: notImplemented,
|
|
64
|
-
findByA11yState: notImplemented,
|
|
65
|
-
findAllByA11yState: notImplemented,
|
|
66
|
-
getByAccessibilityState: notImplemented,
|
|
67
|
-
getAllByAccessibilityState: notImplemented,
|
|
68
|
-
queryByAccessibilityState: notImplemented,
|
|
69
|
-
queryAllByAccessibilityState: notImplemented,
|
|
70
|
-
findByAccessibilityState: notImplemented,
|
|
71
|
-
findAllByAccessibilityState: notImplemented,
|
|
72
|
-
getByA11yValue: notImplemented,
|
|
73
|
-
getAllByA11yValue: notImplemented,
|
|
74
|
-
queryByA11yValue: notImplemented,
|
|
75
|
-
queryAllByA11yValue: notImplemented,
|
|
76
|
-
findByA11yValue: notImplemented,
|
|
77
|
-
findAllByA11yValue: notImplemented,
|
|
78
|
-
getByAccessibilityValue: notImplemented,
|
|
79
|
-
getAllByAccessibilityValue: notImplemented,
|
|
80
|
-
queryByAccessibilityValue: notImplemented,
|
|
81
|
-
queryAllByAccessibilityValue: notImplemented,
|
|
82
|
-
findByAccessibilityValue: notImplemented,
|
|
83
|
-
findAllByAccessibilityValue: notImplemented,
|
|
84
59
|
UNSAFE_getByProps: notImplemented,
|
|
85
60
|
UNSAFE_getAllByProps: notImplemented,
|
|
86
61
|
UNSAFE_queryByProps: notImplemented,
|
package/build/screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","
|
|
1
|
+
{"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","defaultScreen","isDetached","root","UNSAFE_root","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","UNSAFE_getByProps","UNSAFE_getAllByProps","UNSAFE_queryByProps","UNSAFE_queryAllByProps","UNSAFE_getByType","UNSAFE_getAllByType","UNSAFE_queryByType","UNSAFE_queryAllByType","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n get UNSAFE_root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n UNSAFE_getByProps: notImplemented,\n UNSAFE_getAllByProps: notImplemented,\n UNSAFE_queryByProps: notImplemented,\n UNSAFE_queryAllByProps: notImplemented,\n UNSAFE_getByType: notImplemented,\n UNSAFE_getAllByType: notImplemented,\n UNSAFE_queryByType: notImplemented,\n UNSAFE_queryAllByType: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAGA,MAAMA,YAAY,GAAG,qCAAqC;AAE1D,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,MAAM,IAAIC,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAED,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EAChC,MAAM,IAAID,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAMD,MAAMI,aAAqB,GAAG;EAC5BC,UAAU,EAAE,IAAI;EAChB,IAAIC,IAAIA,CAAA,EAAsB;IAC5B,MAAM,IAAIJ,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACD,IAAIO,WAAWA,CAAA,EAAsB;IACnC,MAAM,IAAIL,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACDQ,KAAK,EAAEL,mBAAmB;EAC1BM,MAAM,EAAER,cAAc;EACtBS,OAAO,EAAET,cAAc;EACvBU,QAAQ,EAAEV,cAAc;EACxBW,MAAM,EAAEX,cAAc;EACtBY,cAAc,EAAEZ,cAAc;EAC9Ba,iBAAiB,EAAEb,cAAc;EACjCc,gBAAgB,EAAEd,cAAc;EAChCe,mBAAmB,EAAEf,cAAc;EACnCgB,eAAe,EAAEhB,cAAc;EAC/BiB,kBAAkB,EAAEjB,cAAc;EAClCkB,aAAa,EAAElB,cAAc;EAC7BmB,gBAAgB,EAAEnB,cAAc;EAChCoB,eAAe,EAAEpB,cAAc;EAC/BqB,kBAAkB,EAAErB,cAAc;EAClCsB,cAAc,EAAEtB,cAAc;EAC9BuB,iBAAiB,EAAEvB,cAAc;EACjCwB,aAAa,EAAExB,cAAc;EAC7ByB,gBAAgB,EAAEzB,cAAc;EAChC0B,eAAe,EAAE1B,cAAc;EAC/B2B,k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Ae,EAAEnE,cAAc;EAC/BoE,SAAS,EAAEpE,cAAc;EACzBqE,YAAY,EAAErE,cAAc;EAC5BsE,WAAW,EAAEtE,cAAc;EAC3BuE,cAAc,EAAEvE,cAAc;EAC9BwE,UAAU,EAAExE,cAAc;EAC1ByE,aAAa,EAAEzE;AACjB,CAAC;AAEM,IAAI0E,MAAc,GAAAC,OAAA,CAAAD,MAAA,GAAGvE,aAAa;AAElC,SAASyE,eAAeA,CAACC,YAA0B,EAAE;EAC1DF,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGG,YAAY;AACvB;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGvE,aAAa;AACxB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-act.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/
|
|
1
|
+
{"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-act.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/deprecation.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-default.ts","../src/helpers/format.ts","../src/helpers/host-component-names.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/query-name.ts","../src/helpers/string-validation.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/queries/unsafe-props.ts","../src/queries/unsafe-type.ts","../src/test-utils/events.ts","../src/test-utils/index.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.6.3"}
|