import { mockNamespaceIdToString , mockNamespaceStringToId } from './__mocks__' ; import { namespaceToSpaceId , spaceIdToNamespace } from './namespace' ; beforeEach ( ( ) => { jest . clearAllMocks ( ) ; } ) ; describe ( '#spaceIdToNamespace' , ( ) => { it ( 'returns result of namespaceStringToId' , ( ) => { mockNamespaceStringToId . mockReturnValue ( 'bar' ) ; const result = spaceIdToNamespace ( 'foo' ) ; expect ( mockNamespaceStringToId ) . toHaveBeenCalledWith ( 'foo' ) ; expect ( result ) . toEqual ( 'bar' ) ; } ) ; } ) ; describe ( '#namespaceToSpaceId' , ( ) => { it ( 'returns result of namespaceIdToString' , ( ) => { mockNamespaceIdToString . mockReturnValue ( 'bar' ) ; const result = namespaceToSpaceId ( 'foo' ) ; expect ( mockNamespaceIdToString ) . toHaveBeenCalledWith ( 'foo' ) ; expect ( result ) . toEqual ( 'bar' ) ; } ) ; } ) ;