Skip to content

Commit

Permalink
Components: Fix no-node-access violations in ToolsPanel tests (#46313)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Dec 6, 2022
1 parent c23eec5 commit 650626a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/components/src/tools-panel/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,14 +1075,18 @@ describe( 'ToolsPanel', () => {
<ToolsPanelItem { ...altControlProps }>
<div>Item 1</div>
</ToolsPanelItem>
<ToolsPanelItem { ...controlProps }>
<ToolsPanelItem
{ ...controlProps }
data-testid="item-2"
>
<div>Item 2</div>
</ToolsPanelItem>
</ToolsPanelItems>
<ToolsPanelItems>
<ToolsPanelItem
{ ...altControlProps }
label="Item 3"
data-testid="item-3"
isShownByDefault={ true }
>
<div>Item 3</div>
Expand Down Expand Up @@ -1113,8 +1117,8 @@ describe( 'ToolsPanel', () => {
expect( item3 ).toBeInTheDocument();
expect( screen.queryByText( 'Item 4' ) ).not.toBeInTheDocument();

expect( item2.parentElement ).toHaveClass( 'first' );
expect( item3.parentElement ).toHaveClass( 'last' );
expect( screen.getByTestId( 'item-2' ) ).toHaveClass( 'first' );
expect( screen.getByTestId( 'item-3' ) ).toHaveClass( 'last' );
} );
} );
} );

0 comments on commit 650626a

Please sign in to comment.