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 @@ -86,15 +86,23 @@ describe('ui.filter.Filter', function () {
8686 }
8787 } ;
8888 annotations = [ { text : 'cat' } , { text : 'dog' } , { text : 'car' } ] ;
89+ $ . each ( annotations , function ( i , annotation ) {
90+ $ ( '<span class="annotator-hl">' )
91+ . text ( annotation )
92+ . data ( 'annotation' , annotation )
93+ . appendTo ( element ) ;
94+ } ) ;
8995 plugin . filters = { 'text' : testFilter } ;
90- plugin . highlights = {
91- map : function ( ) { return annotations ; }
92- } ;
96+ plugin . highlights = $ ( element ) . find ( '.annotator-hl' ) ;
9397 sandbox . stub ( plugin , 'updateHighlights' ) ;
9498 sandbox . stub ( plugin , 'resetHighlights' ) ;
9599 sandbox . stub ( plugin , 'filterHighlights' ) ;
96100 } ) ;
97101
102+ afterEach ( function ( ) {
103+ $ ( element ) . empty ( ) ;
104+ } ) ;
105+
98106 it ( "should call Filter#updateHighlights()" , function ( ) {
99107 plugin . updateFilter ( testFilter ) ;
100108 assert ( plugin . updateHighlights . calledOnce ) ;
You can’t perform that action at this time.
0 commit comments