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

E2E: Add regression test for spacer block in themes without spacing units #68913

Merged
23 changes: 23 additions & 0 deletions test/e2e/specs/editor/blocks/spacer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,27 @@ test.describe( 'Spacer', () => {
)
).toBeFocused();
} );

test( 'should work in theme without spacing units support', async ( {
editor,
page,
} ) => {
// Mock the theme.json data to simulate a theme without spacing units
await page.evaluate( () => {
const settings = window.wp.data
.select( 'core/block-editor' )
.getSettings();
window.__originalSettings = settings;
window.wp.data.dispatch( 'core/block-editor' ).updateSettings( {
...settings,
spacing: { units: false },
} );
} );

await editor.insertBlock( { name: 'core/spacer' } );

await expect(
editor.canvas.locator( '.block-editor-warning' )
).toBeHidden();
} );
} );
Loading