import type { Space } from '../../common' ; import { DEFAULT_SPACE_ID } from '../../common/constants' ; import type { SpacesClient } from './spaces_client' ; const createSpacesClientMock = ( ) => ( { getAll : jest . fn ( ) . mockResolvedValue ( [ { id : DEFAULT_SPACE_ID , name : 'mock default space' , disabledFeatures : [ ] , _reserved : true , } , ] ) , get : jest . fn ( ) . mockImplementation ( ( spaceId ) => { return Promise . resolve ( { id : spaceId , name : `mock space for ${ spaceId }` , disabledFeatures : [ ] , } ) ; } ) , create : jest . fn ( ) . mockImplementation ( ( space ) => Promise . resolve ( space ) ) , update : jest . fn ( ) . mockImplementation ( ( space ) => Promise . resolve ( space ) ) , delete : jest . fn ( ) , disableLegacyUrlAliases : jest . fn ( ) , } as unknown as jest . Mocked < SpacesClient > ) ; export const spacesClientMock = { create : createSpacesClientMock , } ;