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

Visual tests - Adds testing nesting multiple Columns blocks #5815

Merged
merged 3 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions __device-tests__/gutenberg-editor-sanity-test-1-visual.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {
toggleDarkMode,
isEditorVisible,
} = e2eUtils;
import { NESTED_COLUMNS_3_LEVELS } from './test-editor-data';

describe( 'Gutenberg Editor - Test Suite 1', () => {
describe( 'Columns block', () => {
Expand Down Expand Up @@ -296,5 +297,26 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
await editorPage.dismissBottomSheet();
await editorPage.removeBlock();
} );

it( 'allows deep nesting to at least 3 levels', async () => {
await editorPage.setHtmlContent( NESTED_COLUMNS_3_LEVELS );

// Wait for the block to be rendered
await editorPage.driver.sleep( 3000 );

// Visual test check
const screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

// Remove block
const columnsBlock = await editorPage.getBlockAtPosition(
blockNames.columns
);
await columnsBlock.click();

await editorPage.moveBlockSelectionUp( { toRoot: true } );

await editorPage.removeBlock();
} );
} );
} );
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions __device-tests__/test-editor-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,3 +721,37 @@ export const NESTED_COLUMNS_CASE_2 = `<!-- wp:separator -->
<!-- /wp:paragraph --></div></div>
<!-- /wp:cover --></div></div>
<!-- /wp:cover -->`;

export const NESTED_COLUMNS_3_LEVELS = `<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"></div>
<!-- /wp:column -->

<!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->`;
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 166 files