Skip to content

Commit

Permalink
Fix ugly test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tug committed Dec 3, 2018
1 parent c03c24e commit ce464ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ describe( 'App', () => {
.forEach( ( blockHolder ) => {
if ( 'core/code' === blockHolder.props.name ) {
// TODO: hardcoded indices are ugly and error prone. Can we do better here?
const blockHolderContainer = blockHolder.children[ 0 ].children[ 0 ].children[ 0 ];
const blockHolderContainer = blockHolder.children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ];
const contentComponent = blockHolderContainer.children[ 0 ];
const inputComponent =
contentComponent.children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ]
.children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ];
.children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ].children[ 0 ];

expect( inputComponent.type ).toBe( 'TextInput' );
}
} );
Expand Down

0 comments on commit ce464ee

Please sign in to comment.