Skip to content

Commit

Permalink
Lodash: Remove omit usage from RN test mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Dec 20, 2022
1 parent 09dc184 commit ac3d713
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/native/__mocks__/@wordpress/react-native-aztec/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { TextInput } from 'react-native';
import { omit } from 'lodash';

/**
* WordPress dependencies
Expand All @@ -15,9 +14,8 @@ const AztecInputState = jest.requireActual( '@wordpress/react-native-aztec' )
const AztecKeyCodes = jest.requireActual( '@wordpress/react-native-aztec' )
.default.KeyCodes;

const UNSUPPORTED_PROPS = [ 'style' ];

const RCTAztecView = ( { accessibilityLabel, text, ...rest }, ref ) => {
const { style, ...supportedProps } = rest;
const inputRef = useRef();

useImperativeHandle( ref, () => ( {
Expand All @@ -40,7 +38,7 @@ const RCTAztecView = ( { accessibilityLabel, text, ...rest }, ref ) => {

return (
<TextInput
{ ...omit( rest, UNSUPPORTED_PROPS ) }
{ ...supportedProps }
accessibilityLabel={
accessibilityLabel || `Text input. ${ text.text || 'Empty' }`
}
Expand Down

1 comment on commit ac3d713

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3739439041
📝 Reported issues:

Please sign in to comment.