@@ -281,6 +281,49 @@ describe('EuiManagedFlyout', () => {
281281 } ) ;
282282 } ) ;
283283
284+ describe ( 'size handling' , ( ) => {
285+ it ( 'defaults size to "m" when no size is provided' , ( ) => {
286+ // Import the real validation function to test the actual behavior
287+ const { validateManagedFlyoutSize } = jest . requireActual ( './validation' ) ;
288+
289+ // Temporarily restore the real validation function for this test
290+ const originalMock = require ( './validation' ) . validateManagedFlyoutSize ;
291+ require ( './validation' ) . validateManagedFlyoutSize =
292+ validateManagedFlyoutSize ;
293+
294+ const { getByTestSubject } = renderInProvider (
295+ < EuiManagedFlyout
296+ id = "default-size-test"
297+ level = { LEVEL_MAIN }
298+ onClose = { ( ) => { } }
299+ flyoutMenuProps = { { title : 'Test Flyout' } }
300+ // Explicitly not providing size prop
301+ />
302+ ) ;
303+
304+ // The flyout should render successfully, indicating the default size worked
305+ expect ( getByTestSubject ( 'managed-flyout' ) ) . toBeInTheDocument ( ) ;
306+
307+ // Restore the mock
308+ require ( './validation' ) . validateManagedFlyoutSize = originalMock ;
309+ } ) ;
310+
311+ it ( 'uses provided size when size is explicitly set' , ( ) => {
312+ const { getByTestSubject } = renderInProvider (
313+ < EuiManagedFlyout
314+ id = "explicit-size-test"
315+ level = { LEVEL_MAIN }
316+ size = "s"
317+ onClose = { ( ) => { } }
318+ flyoutMenuProps = { { title : 'Test Flyout' } }
319+ />
320+ ) ;
321+
322+ // The flyout should render successfully with explicit size
323+ expect ( getByTestSubject ( 'managed-flyout' ) ) . toBeInTheDocument ( ) ;
324+ } ) ;
325+ } ) ;
326+
284327 describe ( 'onClose callback behavior' , ( ) => {
285328 it ( 'does not call onClose callback during component cleanup/unmount' , ( ) => {
286329 const onClose = jest . fn ( ) ;
0 commit comments