@@ -88,7 +88,7 @@ describe("test the SearchBar", () => {
8888 let reset = TestUtils . findRenderedDOMComponentWithClass ( tb , "glyphicon-1-close" ) ;
8989 expect ( reset ) . toExist ( ) ;
9090 let search = TestUtils . scryRenderedDOMComponentsWithClass ( tb , "glyphicon-search" ) [ 0 ] ;
91- expect ( search ) . toBe ( undefined ) ;
91+ expect ( search ) . toExist ( ) ;
9292 TestUtils . Simulate . click ( reset ) ;
9393 expect ( spyReset . calls . length ) . toEqual ( 1 ) ;
9494 expect ( input . value ) . toEqual ( "" ) ;
@@ -209,9 +209,10 @@ describe("test the SearchBar", () => {
209209 it ( 'test search and reset buttons both present, splitTools=false' , ( ) => {
210210 const tb = ReactDOM . render ( < SearchBar splitTools = { false } searchText = { "some val" } delay = { 0 } typeAhead = { false } /> , document . getElementById ( "container" ) ) ;
211211 let reset = TestUtils . findRenderedDOMComponentWithClass ( tb , "glyphicon-1-close" ) ;
212- let search = TestUtils . findRenderedDOMComponentWithClass ( tb , "glyphicon-search" ) ;
212+ let search = TestUtils . scryRenderedDOMComponentsWithClass ( tb , "glyphicon-search" ) ;
213213 expect ( reset ) . toExist ( ) ;
214214 expect ( search ) . toExist ( ) ;
215+ expect ( search . length ) . toBe ( 2 ) ;
215216 } ) ;
216217 it ( 'test only search present, splitTools=false' , ( ) => {
217218 const tb = ReactDOM . render ( < SearchBar splitTools = { false } searchText = { "" } delay = { 0 } typeAhead = { false } /> , document . getElementById ( "container" ) ) ;
@@ -237,7 +238,7 @@ describe("test the SearchBar", () => {
237238 let reset = TestUtils . findRenderedDOMComponentWithClass ( tb , "glyphicon-1-close" ) ;
238239 let search = TestUtils . scryRenderedDOMComponentsWithClass ( tb , "glyphicon-search" ) ;
239240 expect ( reset ) . toExist ( ) ;
240- expect ( search . length ) . toBe ( 0 ) ;
241+ expect ( search . length ) . toBe ( 1 ) ;
241242 } ) ;
242243 it ( 'test zoomToPoint and reset, with decimal, with reset' , ( ) => {
243244 const tb = ReactDOM . render ( < SearchBar format = "decimal" coordinate = { { "lat" : 2 , "lon" : 2 } } activeSearchTool = "coordinatesSearch" showOptions searchText = { "va" } delay = { 0 } typeAhead = { false } /> , document . getElementById ( "container" ) ) ;
0 commit comments