import { SPACES } from '../../common/lib/spaces' ; import { getAllTestSuiteFactory } from '../../common/suites/get_all' ; import { FtrProviderContext } from '../../common/ftr_provider_context' ; export default function getAllSpacesTestSuite ( { getService } ) { const supertestWithoutAuth = getService ( 'supertestWithoutAuth' ) ; const esArchiver = getService ( 'esArchiver' ) ; const { getAllTest , createExpectResults } = getAllTestSuiteFactory ( esArchiver , supertestWithoutAuth ) ; describe ( 'get all' , ( ) => { [ { spaceId : SPACES . DEFAULT . spaceId , } , { spaceId : SPACES . SPACE_1 . spaceId , } , ] . forEach ( ( scenario ) => { getAllTest ( `can access all spaces from ${ scenario . spaceId }` , { spaceId : scenario . spaceId , tests : { exists : { statusCode : 200 , response : createExpectResults ( 'default' , 'space_1' , 'space_2' ) , } , copySavedObjectsPurpose : { statusCode : 200 , response : createExpectResults ( 'default' , 'space_1' , 'space_2' ) , } , shareSavedObjectsPurpose : { statusCode : 200 , response : createExpectResults ( 'default' , 'space_1' , 'space_2' ) , } , includeAuthorizedPurposes : { statusCode : 200 , response : createExpectResults ( 'default' , 'space_1' , 'space_2' ) , } , } , } ) ; } ) ; } ) ; }