Skip to content

Commit

Permalink
Fix some snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 1, 2022
1 parent 2716908 commit 9d9f902
Showing 1 changed file with 144 additions and 22 deletions.
166 changes: 144 additions & 22 deletions test/e2e/specs/editor/blocks/list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ test.describe( 'List', () => {
await page.keyboard.type( 'Another list item' );
await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>A list item</li><li>Another list item</li></ul>
<ul><!-- wp:list-item -->
<li>A list item</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>Another list item</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -38,7 +44,9 @@ test.describe( 'List', () => {
await page.keyboard.type( '* ' );
await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>test</li></ul>
<ul><!-- wp:list-item -->
<li>test</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -53,7 +61,9 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list {"ordered":true} -->
<ol><li>A list item</li></ol>
<ol><!-- wp:list-item -->
<li>A list item</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->`
);
} );
Expand Down Expand Up @@ -192,7 +202,9 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>I’m a list</li></ul>
<ul><!-- wp:list-item -->
<li>I’m a list</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -207,7 +219,9 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>test</li></ul>
<ul><!-- wp:list-item -->
<li>test</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -227,7 +241,13 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one</li><li>two</li></ul>
<ul><!-- wp:list-item -->
<li>one</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>two</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -245,7 +265,13 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one</li><li>two</li></ul>
<ul><!-- wp:list-item -->
<li>one</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>two</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -268,7 +294,13 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one<br>...</li><li>two</li></ul>
<ul><!-- wp:list-item -->
<li>one<br>...</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>two</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand Down Expand Up @@ -323,7 +355,13 @@ test.describe( 'List', () => {
await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:list -->
<ul><li>one</li><li>two</li></ul>
<ul><!-- wp:list-item -->
<li>one</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>two</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></blockquote>
<!-- /wp:quote -->`
);
Expand All @@ -341,7 +379,9 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one</li></ul>
<ul><!-- wp:list-item -->
<li>one</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
Expand All @@ -355,8 +395,14 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one</li><li>two</li></ul>
<!-- /wp:list -->`
<ul><!-- wp:list-item -->
<li>one</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>two</p>
<!-- /wp:paragraph -->`
);
} );

Expand All @@ -374,7 +420,17 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one</li><li></li><li>two</li></ul>
<ul><!-- wp:list-item -->
<li>one</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li></li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>two</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

Expand Down Expand Up @@ -450,7 +506,17 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>one<ul><li>two</li><li>three</li></ul></li></ul>
<ul><!-- wp:list-item -->
<li>one<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>two</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>three</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand Down Expand Up @@ -606,7 +672,9 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>a<br></li></ul>
<ul><!-- wp:list-item -->
<li>a<br></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -627,7 +695,17 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>a</li><li>b<br></li><li>c</li></ul>
<ul><!-- wp:list-item -->
<li>a</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>b<br></li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li>c</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);
} );
Expand All @@ -646,7 +724,17 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>1<ul><li>a<ul><li>i</li></ul></li></ul></li></ul>
<ul><!-- wp:list-item -->
<li>1<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>a<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>i</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

Expand All @@ -655,23 +743,49 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>1<ul><li>a</li><li></li></ul></li></ul>
<ul><!-- wp:list-item -->
<li>1<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>a</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

await page.keyboard.press( 'Backspace' ); // Should be at level 0.

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>1<ul><li>a</li></ul></li><li></li></ul>
<ul><!-- wp:list-item -->
<li>1<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>a</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

await page.keyboard.press( 'Backspace' ); // Should be at level 1.

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>1<ul><li>a</li></ul></li></ul>
<ul><!-- wp:list-item -->
<li>1<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>a</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

Expand All @@ -680,15 +794,23 @@ test.describe( 'List', () => {

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>1</li><li></li></ul>
<ul><!-- wp:list-item -->
<li>1</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

await page.keyboard.press( 'Backspace' ); // Should be at level 0.

await expect.poll( editor.getEditedPostContent ).toBe(
`<!-- wp:list -->
<ul><li>1</li></ul>
<ul><!-- wp:list-item -->
<li>1</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->`
);

Expand Down

0 comments on commit 9d9f902

Please sign in to comment.