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 () {
86
86
}
87
87
} ;
88
88
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
+ } ) ;
89
95
plugin . filters = { 'text' : testFilter } ;
90
- plugin . highlights = {
91
- map : function ( ) { return annotations ; }
92
- } ;
96
+ plugin . highlights = $ ( element ) . find ( '.annotator-hl' ) ;
93
97
sandbox . stub ( plugin , 'updateHighlights' ) ;
94
98
sandbox . stub ( plugin , 'resetHighlights' ) ;
95
99
sandbox . stub ( plugin , 'filterHighlights' ) ;
96
100
} ) ;
97
101
102
+ afterEach ( function ( ) {
103
+ $ ( element ) . empty ( ) ;
104
+ } ) ;
105
+
98
106
it ( "should call Filter#updateHighlights()" , function ( ) {
99
107
plugin . updateFilter ( testFilter ) ;
100
108
assert ( plugin . updateHighlights . calledOnce ) ;
You can’t perform that action at this time.
0 commit comments