This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,23 @@ describe('Worldmap', () => {
296296 } ) ;
297297 } ) ;
298298
299+ describe ( 'when there is not lat/long' , ( ) => {
300+ beforeEach ( ( ) => {
301+ let data = new DataBuilder ( ) . build ( ) ;
302+ data . push ( {
303+ "key" : "undefined_undefined" ,
304+ "locationName" : "US" ,
305+ "value" : 2535200 ,
306+ "valueFormatted" : 2535200
307+ } )
308+ ctrl . data = data
309+ } ) ;
310+
311+ it ( 'should not crash' , ( ) => {
312+ expect ( ( ) => worldMap . drawCircles ( ) ) . not . toThrowError ( ) ;
313+ } ) ;
314+ } ) ;
315+
299316 describe ( 'when three thresholds are set' , ( ) => {
300317 beforeEach ( ( ) => {
301318 ctrl . data = new DataBuilder ( ) . withThresholdValues ( [ 2 , 4 , 6 ] ) . build ( ) ;
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export default class WorldMap {
128128 createCircles ( data ) {
129129 const circles : any [ ] = [ ] ;
130130 data . forEach ( dataPoint => {
131- if ( ! dataPoint . locationName ) {
131+ if ( ! dataPoint . locationName || ! dataPoint . locationLatitude || ! dataPoint . locationLongitude ) {
132132 return ;
133133 }
134134 circles . push ( this . createCircle ( dataPoint ) ) ;
You can’t perform that action at this time.
0 commit comments