Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrde jest to v29 #1473

Merged
merged 18 commits into from
Aug 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
chore: fix react native tests
snitin315 committed Aug 2, 2023
commit a21fd86a61d279ed1095ada8a001ce7ba784c153
6 changes: 6 additions & 0 deletions packages/blade/jest-setup.native.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/** Setup the React Native globals to differentiate between a web and react native app.
* For browser we have `window`, for node we have `process` as globals, for React Native it's `global.navigator.product: ReactNative`
**/
import { configure } from '@testing-library/react-native';

// Since v12, all queries exclude elements hidden from accessibility by default
configure({
defaultIncludeHiddenElements: true,
});

Object.defineProperty(global.navigator, 'product', {
value: 'ReactNative',
Original file line number Diff line number Diff line change
@@ -200,7 +200,6 @@ exports[`<Accordion /> should render 1`] = `
>
<View
accessibilityElementsHidden={true}
accessible={false}
importantForAccessibility="no-hide-descendants"
style={
{
@@ -214,7 +213,6 @@ exports[`<Accordion /> should render 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
@@ -275,7 +273,6 @@ exports[`<Accordion /> should render 1`] = `
<View
accessibilityElementsHidden={true}
accessibilityRole="summary"
accessible={false}
data-blade-component="collapsible-body"
id="collapsible-body-1"
importantForAccessibility="no-hide-descendants"
@@ -377,7 +374,6 @@ exports[`<Accordion /> should render 1`] = `
/>
<View
accessibilityElementsHidden={true}
accessible={false}
data-blade-component="base-box"
importantForAccessibility="no-hide-descendants"
style={
@@ -608,7 +604,6 @@ exports[`<Accordion /> should render 1`] = `
>
<View
accessibilityElementsHidden={true}
accessible={false}
importantForAccessibility="no-hide-descendants"
style={
{
@@ -622,7 +617,6 @@ exports[`<Accordion /> should render 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
@@ -683,7 +677,6 @@ exports[`<Accordion /> should render 1`] = `
<View
accessibilityElementsHidden={true}
accessibilityRole="summary"
accessible={false}
data-blade-component="collapsible-body"
id="collapsible-body-2"
importantForAccessibility="no-hide-descendants"
@@ -785,7 +778,6 @@ exports[`<Accordion /> should render 1`] = `
/>
<View
accessibilityElementsHidden={true}
accessible={false}
data-blade-component="base-box"
importantForAccessibility="no-hide-descendants"
style={
@@ -1016,7 +1008,6 @@ exports[`<Accordion /> should render 1`] = `
>
<View
accessibilityElementsHidden={true}
accessible={false}
importantForAccessibility="no-hide-descendants"
style={
{
@@ -1030,7 +1021,6 @@ exports[`<Accordion /> should render 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
@@ -1091,7 +1081,6 @@ exports[`<Accordion /> should render 1`] = `
<View
accessibilityElementsHidden={true}
accessibilityRole="summary"
accessible={false}
data-blade-component="collapsible-body"
id="collapsible-body-3"
importantForAccessibility="no-hide-descendants"
@@ -1193,7 +1182,6 @@ exports[`<Accordion /> should render 1`] = `
/>
<View
accessibilityElementsHidden={true}
accessible={false}
data-blade-component="base-box"
importantForAccessibility="no-hide-descendants"
style={
Original file line number Diff line number Diff line change
@@ -63,7 +63,6 @@ exports[`<Alert /> should render 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -229,7 +228,6 @@ exports[`<Alert /> should render 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -351,7 +349,6 @@ exports[`<Alert /> should render positive intent and full width 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
@@ -527,7 +524,6 @@ exports[`<Alert /> should render positive intent and full width 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -77,7 +77,6 @@ exports[`<Badge /> should render Badge with Icon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="12px"
bbWidth="12px"
Original file line number Diff line number Diff line change
@@ -917,7 +917,6 @@ exports[`<BottomSheet /> should render Header/Footer/Body properly 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
@@ -1557,7 +1556,6 @@ exports[`<BottomSheet /> should render empty header 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -403,7 +403,6 @@ exports[`<BaseButton /> should render button with icon with default iconPosition
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -617,7 +616,6 @@ exports[`<BaseButton /> should render button with icon with left iconPosition 1`
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -864,7 +862,6 @@ exports[`<BaseButton /> should render button with icon with right iconPosition 1
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -1044,7 +1041,6 @@ exports[`<BaseButton /> should render button with icon without text 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
@@ -3514,7 +3510,6 @@ exports[`<BaseButton /> should render loading button 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -403,7 +403,6 @@ exports[`<Button /> should render button with icon with default iconPosition 1`]
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -650,7 +649,6 @@ exports[`<Button /> should render button with icon with right iconPosition 1`] =
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ exports[`<IconButton /> should render 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
Original file line number Diff line number Diff line change
@@ -666,7 +666,6 @@ exports[`<Card /> should render a Card with Header 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="24px"
bbWidth="24px"
Original file line number Diff line number Diff line change
@@ -514,7 +514,6 @@ exports[`<Checkbox /> should set error state with validationState 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="12px"
bbWidth="12px"
Original file line number Diff line number Diff line change
@@ -177,7 +177,6 @@ exports[`<Collapsible /> should render with CollapsibleButton 1`] = `
<View
accessibilityElementsHidden={true}
accessibilityRole="summary"
accessible={false}
data-blade-component="collapsible-body"
id="collapsible-body-1"
importantForAccessibility="no-hide-descendants"
@@ -574,7 +573,6 @@ exports[`<Collapsible /> should render with CollapsibleLink 1`] = `
>
<View
accessibilityElementsHidden={true}
accessible={false}
importantForAccessibility="no-hide-descendants"
style={
{
@@ -588,7 +586,6 @@ exports[`<Collapsible /> should render with CollapsibleLink 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
@@ -649,7 +646,6 @@ exports[`<Collapsible /> should render with CollapsibleLink 1`] = `
<View
accessibilityElementsHidden={true}
accessibilityRole="summary"
accessible={false}
data-blade-component="collapsible-body"
id="collapsible-body-3"
importantForAccessibility="no-hide-descendants"
Original file line number Diff line number Diff line change
@@ -364,7 +364,6 @@ exports[`<Dropdown /> should render dropdown 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="16px"
bbWidth="16px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<ActivityIcon /> should render ActivityIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AirplayIcon /> should render AirplayIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlertCircleIcon /> should render AlertCircleIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlertOctagonIcon /> should render AlertOctagonIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlertOnlyIcon /> should render AlertOnlyIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlertTriangleIcon /> should render AlertTriangleIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlignCenterIcon /> should render AlignCenterIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlignJustifyIcon /> should render AlignJustifyIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlignLeftIcon /> should render AlignLeftIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AlignRightIcon /> should render AlignRightIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AnchorIcon /> should render AnchorIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AnnouncementIcon /> should render AnnouncementIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<ApertureIcon /> should render ApertureIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ exports[`<AppStoreIcon /> should render AppStoreIcon 1`] = `
>
<RNSVGSvgView
accessibilityElementsHidden={true}
accessible={false}
align="xMidYMid"
bbHeight="20px"
bbWidth="20px"
Loading