import { getNonUniqueEntries } from './get_non_unique_entries' ; const foo1 = { type : 'foo' , id : '1' } ; const foo2 = { type : 'foo' , id : '2' } ; const bar1 = { type : 'bar' , id : '1' } ; describe ( '#getNonUniqueEntries' , ( ) => { test ( 'returns empty array if entries are unique' , ( ) => { const result = getNonUniqueEntries ( [ foo1 , foo2 , bar1 ] ) ; expect ( result ) . toEqual ( [ ] ) ; } ) ; test ( 'returns non-empty array for non-unique results' , ( ) => { const result1 = getNonUniqueEntries ( [ foo1 , foo2 , foo1 ] ) ; const result2 = getNonUniqueEntries ( [ foo1 , foo2 , foo1 , foo2 ] ) ; expect ( result1 ) . toEqual ( [ `${ foo1 . type }:${ foo1 . id }` ] ) ; expect ( result2 ) . toEqual ( [ `${ foo1 . type }:${ foo1 . id }` , `${ foo2 . type }:${ foo2 . id }` ] ) ; } ) ; } ) ;