import { SPACES } from '../../common/lib/spaces' ; import { testCaseFailures , getTestScenarios } from '../../common/lib/saved_object_test_utils' ; import { FtrProviderContext } from '../../common/ftr_provider_context' ; import { bulkResolveTestSuiteFactory , TEST_CASES as CASES } from '../../common/suites/bulk_resolve' ; const { SPACE_1 : { spaceId : SPACE_1_ID } , } = SPACES ; const { fail400 , fail404 } = testCaseFailures ; const createTestCases = ( spaceId ) => [ CASES . EXACT_MATCH , { ... CASES . ALIAS_MATCH , ... fail404 ( spaceId !== SPACE_1_ID ) } , { ... CASES . CONFLICT , ... ( spaceId !== SPACE_1_ID && { expectedOutcome : 'exactMatch' as const } ) , } , { ... CASES . DISABLED , ... fail404 ( ) } , { ... CASES . HIDDEN , ... fail400 ( ) } , { ... CASES . DOES_NOT_EXIST , ... fail404 ( ) } , ] ; export default function ( { getService } ) { const supertest = getService ( 'supertest' ) ; const esArchiver = getService ( 'esArchiver' ) ; const { addTests , createTestDefinitions } = bulkResolveTestSuiteFactory ( esArchiver , supertest ) ; const createTests = ( spaceId ) => { const testCases = createTestCases ( spaceId ) ; return createTestDefinitions ( testCases , false , { spaceId , singleRequest : true } ) ; } ; describe ( '_bulk_resolve' , ( ) => { getTestScenarios ( ) . spaces . forEach ( ( { spaceId } ) => { const tests = createTests ( spaceId ) ; addTests ( `within the ${ spaceId } space` , { spaceId , tests } ) ; } ) ; } ) ; }