Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 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,29 @@ test.describe( 'Spacer', () => {
)
).toBeFocused();
} );

test( 'should work in theme without spacing units support', async ( {
editor,
page,
} ) => {
await page.waitForFunction( () => window?.wp?.data );

// Mock the theme.json data to simulate a theme without spacing units
Comment thread
Mamaduka marked this conversation as resolved.
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();
} );
} );