File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -124,15 +124,23 @@ describe('ui.filter.Filter', function () {
124124 }
125125 } ;
126126 annotations = [ { text : 'cat' } , { text : 'dog' } , { text : 'car' } ] ;
127+ $ . each ( annotations , function ( i , annotation ) {
128+ $ ( '<span class="annotator-hl">' )
129+ . text ( annotation )
130+ . data ( 'annotation' , annotation )
131+ . appendTo ( element ) ;
132+ } ) ;
127133 plugin . filters = { 'text' : testFilter } ;
128- plugin . highlights = {
129- map : function ( ) { return annotations ; }
130- } ;
134+ plugin . highlights = $ ( element ) . find ( '.annotator-hl' ) ;
131135 sandbox . stub ( plugin , 'updateHighlights' ) ;
132136 sandbox . stub ( plugin , 'resetHighlights' ) ;
133137 sandbox . stub ( plugin , 'filterHighlights' ) ;
134138 } ) ;
135139
140+ afterEach ( function ( ) {
141+ $ ( element ) . empty ( ) ;
142+ } ) ;
143+
136144 it ( "should call Filter#updateHighlights()" , function ( ) {
137145 plugin . updateFilter ( testFilter ) ;
138146 assert ( plugin . updateHighlights . calledOnce ) ;
You can’t perform that action at this time.
0 commit comments