Skip to content

Commit

Permalink
expect warning and close nav panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Addison-Stavlo committed Nov 6, 2020
1 parent 9fd1f0c commit db3f167
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/e2e-tests/specs/experiments/template-part.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe( 'Template Part', () => {
await navigationPanel.backToRoot();
await navigationPanel.navigate( 'Templates' );
await navigationPanel.clickItemByText( 'Front Page' );
await navigationPanel.close();
}

it( 'Should load customizations when in a template even if only the slug and theme attributes are set.', async () => {
Expand Down Expand Up @@ -108,7 +109,7 @@ describe( 'Template Part', () => {
);
expect(
initialTemplateParts.length - finalTemplateParts.length
).toEqual( 1 );
).toBe( 1 );

// Verify content of the template part is still present.
const [ expectedContent ] = await page.$x(
Expand All @@ -118,6 +119,7 @@ describe( 'Template Part', () => {
} );

it( 'Should convert selected block(s) to template part', async () => {
await page.waitForSelector( '.wp-block-template-part' );
const initialTemplateParts = await page.$$(
'.wp-block-template-part'
);
Expand Down Expand Up @@ -146,13 +148,18 @@ describe( 'Template Part', () => {
);
expect( newTemplatePart ).not.toBeNull();

// TODO: Remove when toolbar supports text fields
expect( console ).toHaveWarnedWith(
'Using custom components as toolbar controls is deprecated. Please use ToolbarItem or ToolbarButton components instead. See: https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols'
);

// Verify there is 1 more template part on the page than previously.
const finalTemplateParts = await page.$$(
'.wp-block-template-part'
);
expect(
finalTemplateParts.length - initialTemplateParts.length
).toEqual( 1 );
).toBe( 1 );
} );
} );

Expand Down

0 comments on commit db3f167

Please sign in to comment.