Skip to content

Commit

Permalink
Work around last-child margin being applied to appender
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed May 27, 2024
1 parent d407029 commit a10f171
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,18 @@ test.describe( 'Paragraph computed styles', () => {
},
],
} );

// Select a different block so that :last-child margin is applied correctly.
// This is to work around a bug. See this issue:
// https://github.com/WordPress/gutenberg/issues/61846
await editor.selectBlocks( rootParagraph2 );
const nestedParagraph1 = paragraphs.nth( 3 );
const nestedParagraph2 = paragraphs.nth( 4 );
const nestedParagraph3 = paragraphs.nth( 5 );
// In a default layout, the margins on left/right apply to the
// middle paragraph.
// The first and last block have start/end margin set to zero
// by the layout.
await expect( nestedParagraph1 ).toHaveCSS(
'margin',
'0px 2px 3px 4px'
Expand All @@ -389,11 +396,9 @@ test.describe( 'Paragraph computed styles', () => {
'margin',
'1px 2px 3px 4px'
);
// Note: This is different to what I reproduce locally.
// Bottom margin should be 0px for the last block.
await expect( nestedParagraph3 ).toHaveCSS(
'margin',
'1px 2px 3px 4px'
'1px 2px 0px 4px'
);

// Expect a paragraph with a background color to have some
Expand Down

0 comments on commit a10f171

Please sign in to comment.