Skip to content

Commit

Permalink
Fix some e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 29, 2022
1 parent 8249538 commit 2716908
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ exports[`cpt locking template_lock false should allow blocks to be inserted 1`]
<!-- /wp:columns -->
<!-- wp:list -->
<ul><li>List content</li></ul>
<ul><!-- wp:list-item -->
<li>List content</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->"
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ exports[`block deletion - deleting the third and fourth blocks using backspace w
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>caret was here</li></ul>
<ul><!-- wp:list-item -->
<li>caret was here</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->"
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ exports[`Multi-block selection should multi-select from within the list block 1`
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>1</li></ul>
<ul><!-- wp:list-item -->
<li>1</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->"
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ exports[`RichText should paste paragraph contents into list 1`] = `
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>1</li><li>2</li></ul>
<ul><!-- wp:list-item -->
<li>1<br>2</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->"
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ exports[`Writing Flow should navigate empty paragraphs 1`] = `
exports[`Writing Flow should not create extra line breaks in multiline value 1`] = `
"<!-- wp:list -->
<ul><li></li></ul>
<ul><!-- wp:list-item -->
<li></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->"
`;
Expand Down
14 changes: 11 additions & 3 deletions packages/e2e-tests/specs/editor/various/block-switcher.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ describe( 'Block Switcher', () => {
// Insert a list block.
await insertBlock( 'List' );
await page.keyboard.type( 'List content' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowUp' );
await pressKeyWithModifier( 'alt', 'F10' );

// Verify the block switcher exists.
Expand All @@ -31,7 +33,6 @@ describe( 'Block Switcher', () => {
'Heading',
'Quote',
'Columns',
'Table of Contents',
] )
);
} );
Expand All @@ -45,6 +46,8 @@ describe( 'Block Switcher', () => {
// Insert a list block.
await insertBlock( 'List' );
await page.keyboard.type( 'List content' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowUp' );
await pressKeyWithModifier( 'alt', 'F10' );

// Verify the block switcher exists.
Expand All @@ -56,7 +59,7 @@ describe( 'Block Switcher', () => {
'Group',
'Paragraph',
'Heading',
'Table of Contents',
'Columns',
] )
);
} );
Expand All @@ -71,13 +74,14 @@ describe( 'Block Switcher', () => {
'core/group',
'core/heading',
'core/columns',
'core/table-of-contents',
].map( ( block ) => wp.blocks.unregisterBlockType( block ) );
} );

// Insert a list block.
await insertBlock( 'List' );
await page.keyboard.type( 'List content' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowUp' );
await pressKeyWithModifier( 'alt', 'F10' );

// Verify the block switcher exists.
Expand All @@ -91,6 +95,8 @@ describe( 'Block Switcher', () => {
it( 'Should show Columns block only if selected blocks are between limits (1-6)', async () => {
await insertBlock( 'List' );
await page.keyboard.type( 'List content' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowUp' );
await insertBlock( 'Heading' );
await page.keyboard.type( 'I am a header' );
await page.keyboard.down( 'Shift' );
Expand All @@ -103,6 +109,8 @@ describe( 'Block Switcher', () => {
it( 'Should NOT show Columns transform only if selected blocks are more than max limit(6)', async () => {
await insertBlock( 'List' );
await page.keyboard.type( 'List content' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowUp' );
await insertBlock( 'Heading' );
await page.keyboard.type( 'I am a header' );
await page.keyboard.press( 'Enter' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ describe( 'Keep styles on block transforms', () => {
expect( await getEditedPostContent() ).toMatchSnapshot();
} );

it( 'Should keep the font size during a transform from multiple blocks into a single one', async () => {
// Create a paragraph block with some content.
await clickBlockAppender();
await page.keyboard.type( 'Line 1 to be made large' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( 'Line 2 to be made large' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( 'Line 3 to be made large' );
await pressKeyWithModifier( 'shift', 'ArrowUp' );
await pressKeyWithModifier( 'shift', 'ArrowUp' );
await page.click(
'[role="radiogroup"][aria-label="Font size"] [aria-label="Large"]'
);
await transformBlockTo( 'List' );
expect( await getEditedPostContent() ).toMatchSnapshot();
} );

it( 'Should keep the font size during a transform from multiple blocks into multiple blocks', async () => {
// Create a paragraph block with some content.
await clickBlockAppender();
Expand Down

0 comments on commit 2716908

Please sign in to comment.