import React from 'react' ; import { shallowWithIntl } from '@kbn/test/jest' ; import { ManageSpacesButton } from './manage_spaces_button' ; describe ( 'ManageSpacesButton' , ( ) => { it ( 'renders as expected' , ( ) => { const component = ( < ManageSpacesButton navigateToApp = { jest . fn ( ) } capabilities = { { navLinks : { } , management : { } , catalogue : { } , spaces : { manage : true , } , } } />); expect ( shallowWithIntl ( component ) ) . toMatchSnapshot ( ) ; } ) ; it ( `doesn't render if user profile forbids managing spaces` , ( ) => { const component = ( < ManageSpacesButton navigateToApp = { jest . fn ( ) } capabilities = { { navLinks : { } , management : { } , catalogue : { } , spaces : { manage : false , } , } } />); expect ( shallowWithIntl ( component ) ) . toMatchSnapshot ( ) ; } ) ; } ) ;