File tree 1 file changed +25
-0
lines changed
test/e2e/specs/editor/blocks
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -48,4 +48,29 @@ test.describe( 'Spacer', () => {
48
48
)
49
49
) . toBeFocused ( ) ;
50
50
} ) ;
51
+
52
+ test ( 'should work in theme without spacing units support' , async ( {
53
+ editor,
54
+ page,
55
+ } ) => {
56
+ await page . waitForFunction ( ( ) => window ?. wp ?. data ) ;
57
+
58
+ // Mock the theme.json data to simulate a theme without spacing units
59
+ await page . evaluate ( ( ) => {
60
+ const settings = window . wp . data
61
+ . select ( 'core/block-editor' )
62
+ . getSettings ( ) ;
63
+ window . __originalSettings = settings ;
64
+ window . wp . data . dispatch ( 'core/block-editor' ) . updateSettings ( {
65
+ ...settings ,
66
+ spacing : { units : false } ,
67
+ } ) ;
68
+ } ) ;
69
+
70
+ await editor . insertBlock ( { name : 'core/spacer' } ) ;
71
+
72
+ await expect (
73
+ editor . canvas . locator ( '.block-editor-warning' )
74
+ ) . toBeHidden ( ) ;
75
+ } ) ;
51
76
} ) ;
You can’t perform that action at this time.
0 commit comments