diff --git a/packages/block-editor/src/components/warning/index.js b/packages/block-editor/src/components/warning/index.js index 84c17726a518f6..4891c0a90df98f 100644 --- a/packages/block-editor/src/components/warning/index.js +++ b/packages/block-editor/src/components/warning/index.js @@ -13,50 +13,55 @@ import { moreHorizontal } from '@wordpress/icons'; function Warning( { className, actions, children, secondaryActions } ) { return ( -
-
-

{ children }

+
+
+
+

+ { children } +

- { ( Children.count( actions ) > 0 || secondaryActions ) && ( -
- { Children.count( actions ) > 0 && - Children.map( actions, ( action, i ) => ( - 0 || secondaryActions ) && ( +
+ { Children.count( actions ) > 0 && + Children.map( actions, ( action, i ) => ( + + { action } + + ) ) } + { secondaryActions && ( + - { action } - - ) ) } - { secondaryActions && ( - - { () => ( - - { secondaryActions.map( - ( item, pos ) => ( - - { item.title } - - ) - ) } - - ) } - - ) } -
- ) } + { () => ( + + { secondaryActions.map( + ( item, pos ) => ( + + { item.title } + + ) + ) } + + ) } + + ) } +
+ ) } +
); diff --git a/packages/block-editor/src/components/warning/test/__snapshots__/index.js.snap b/packages/block-editor/src/components/warning/test/__snapshots__/index.js.snap index 8025afed4c550e..dae4cd686b3c64 100644 --- a/packages/block-editor/src/components/warning/test/__snapshots__/index.js.snap +++ b/packages/block-editor/src/components/warning/test/__snapshots__/index.js.snap @@ -2,16 +2,25 @@ exports[`Warning should match snapshot 1`] = `
-

- error -

+

+ error +

+
`; diff --git a/packages/block-editor/src/components/warning/test/index.js b/packages/block-editor/src/components/warning/test/index.js index b8fcdbee4e4900..d829a5b931fad1 100644 --- a/packages/block-editor/src/components/warning/test/index.js +++ b/packages/block-editor/src/components/warning/test/index.js @@ -18,7 +18,7 @@ describe( 'Warning', () => { it( 'should have valid class', () => { const wrapper = shallow( ); - expect( wrapper.hasClass( 'block-editor-warning' ) ).toBe( true ); + expect( wrapper.find( '.block-editor-warning' ) ).toHaveLength( 1 ); expect( wrapper.find( '.block-editor-warning__actions' ) ).toHaveLength( 0 );