Skip to content

Commit

Permalink
Add a basic test for overriding reset styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed May 14, 2024
1 parent 8c38ca2 commit fcfce73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 0 additions & 4 deletions packages/block-library/src/social-links/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
transform: none;
}

.editor-styles-wrapper .wp-block-social-links {
padding: 0;
}

// Placeholder/setup state.
.wp-block-social-links__social-placeholder {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/social-links/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.wp-block-social-links {
:root :where(.wp-block-social-links) {
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

Expand Down
17 changes: 17 additions & 0 deletions test/e2e/specs/editor/various/styles.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'Styles', () => {
test( 'should override reset styles', async ( { admin, editor } ) => {
await admin.createNewPost( { postType: 'page' } );
await editor.insertBlock( { name: 'core/social-links' } );

const block = editor.canvas.getByRole( 'document', {
name: 'Block: Social Icons',
} );

await expect( block ).toHaveCSS( 'padding-left', '0px' );
} );
} );

0 comments on commit fcfce73

Please sign in to comment.