@@ -30,18 +30,16 @@ describe('SearchResults', () => {
3030 it ( 'renders a SearchHit for each hit' , ( ) => {
3131 const selectContentSearchAnnotation = jest . fn ( ) ;
3232 const wrapper = createWrapper ( { selectContentSearchAnnotation } ) ;
33- const searchHits = wrapper . find ( 'LiveMessenger' ) . props ( ) . children ( { } ) ;
34-
33+ const searchHits = wrapper . find ( 'Connect(WithStyles(WithPlugins(SearchHit)))' ) ;
3534 expect ( searchHits . length ) . toEqual ( 1 ) ;
36- expect ( searchHits [ 0 ] . type . displayName ) . toEqual ( 'Connect(WithStyles(WithPlugins(SearchHit)))' ) ;
37- expect ( searchHits [ 0 ] . props . index ) . toEqual ( 0 ) ;
35+ expect ( searchHits . first ( ) . props ( ) . index ) . toEqual ( 0 ) ;
3836 } ) ;
3937
4038 it ( 'can focus on a single item' , ( ) => {
4139 const wrapper = createWrapper ( { } ) ;
42- const searchHits = wrapper . find ( 'LiveMessenger' ) . props ( ) . children ( { } ) ;
40+ const searchHits = wrapper . find ( 'Connect(WithStyles(WithPlugins(SearchHit)))' ) ;
4341
44- searchHits [ 0 ] . props . showDetails ( ) ;
42+ searchHits . first ( ) . props ( ) . showDetails ( ) ;
4543 expect ( wrapper . state ( ) . focused ) . toEqual ( true ) ;
4644 } ) ;
4745
@@ -54,28 +52,20 @@ describe('SearchResults', () => {
5452 expect ( wrapper . state ( ) . focused ) . toEqual ( false ) ;
5553 } ) ;
5654
57- it ( 'passes announcePolite function to the SearchHits' , ( ) => {
58- const announcePolite = jest . fn ( ) ;
59- const wrapper = createWrapper ( { } ) ;
60- const searchHits = wrapper . find ( 'LiveMessenger' ) . props ( ) . children ( { announcePolite } ) ;
61-
62- expect ( searchHits [ 0 ] . props . announcer ) . toEqual ( announcePolite ) ;
63- } ) ;
64-
6555 describe ( 'annotation-only search results' , ( ) => {
6656 it ( 'renders a SearchHit for each annotation' , ( ) => {
6757 const wrapper = createWrapper ( {
6858 searchAnnotations : [ { id : 'x' } , { id : 'y' } ] ,
6959 searchHits : [ ] ,
7060 } ) ;
7161
72- const searchHits = wrapper . find ( 'LiveMessenger' ) . props ( ) . children ( { } ) ;
62+ const searchHits = wrapper . find ( 'Connect(WithStyles(WithPlugins(SearchHit)))' ) ;
7363 expect ( searchHits . length ) . toEqual ( 2 ) ;
74- expect ( searchHits [ 0 ] . props . index ) . toEqual ( 0 ) ;
75- expect ( searchHits [ 0 ] . props . annotationId ) . toEqual ( 'x' ) ;
64+ expect ( searchHits . get ( 0 ) . props . index ) . toEqual ( 0 ) ;
65+ expect ( searchHits . get ( 0 ) . props . annotationId ) . toEqual ( 'x' ) ;
7666
77- expect ( searchHits [ 1 ] . props . index ) . toEqual ( 1 ) ;
78- expect ( searchHits [ 1 ] . props . annotationId ) . toEqual ( 'y' ) ;
67+ expect ( searchHits . get ( 1 ) . props . index ) . toEqual ( 1 ) ;
68+ expect ( searchHits . get ( 1 ) . props . annotationId ) . toEqual ( 'y' ) ;
7969 } ) ;
8070 } ) ;
8171
0 commit comments