import { SPACES } from '../../common/lib/spaces' ; import { updateTestSuiteFactory } from '../../common/suites/update' ; import { FtrProviderContext } from '../../common/ftr_provider_context' ; export default function updateSpaceTestSuite ( { getService } ) { const supertestWithoutAuth = getService ( 'supertestWithoutAuth' ) ; const esArchiver = getService ( 'esArchiver' ) ; const { updateTest , expectAlreadyExistsResult , expectDefaultSpaceResult , expectNotFound } = updateTestSuiteFactory ( esArchiver , supertestWithoutAuth ) ; describe ( 'update' , ( ) => { [ { spaceId : SPACES . DEFAULT . spaceId , } , { spaceId : SPACES . SPACE_1 . spaceId , } , ] . forEach ( ( scenario ) => { updateTest ( `can update from the ${ scenario . spaceId } space` , { spaceId : scenario . spaceId , tests : { alreadyExists : { statusCode : 200 , response : expectAlreadyExistsResult , } , defaultSpace : { statusCode : 200 , response : expectDefaultSpaceResult , } , newSpace : { statusCode : 404 , response : expectNotFound , } , } , } ) ; } ) ; } ) ; }