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 () {
124
124
}
125
125
} ;
126
126
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
+ } ) ;
127
133
plugin . filters = { 'text' : testFilter } ;
128
- plugin . highlights = {
129
- map : function ( ) { return annotations ; }
130
- } ;
134
+ plugin . highlights = $ ( element ) . find ( '.annotator-hl' ) ;
131
135
sandbox . stub ( plugin , 'updateHighlights' ) ;
132
136
sandbox . stub ( plugin , 'resetHighlights' ) ;
133
137
sandbox . stub ( plugin , 'filterHighlights' ) ;
134
138
} ) ;
135
139
140
+ afterEach ( function ( ) {
141
+ $ ( element ) . empty ( ) ;
142
+ } ) ;
143
+
136
144
it ( "should call Filter#updateHighlights()" , function ( ) {
137
145
plugin . updateFilter ( testFilter ) ;
138
146
assert ( plugin . updateHighlights . calledOnce ) ;
You can’t perform that action at this time.
0 commit comments