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', () => {
296
296
} ) ;
297
297
} ) ;
298
298
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
+
299
316
describe ( 'when three thresholds are set' , ( ) => {
300
317
beforeEach ( ( ) => {
301
318
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 {
128
128
createCircles ( data ) {
129
129
const circles : any [ ] = [ ] ;
130
130
data . forEach ( dataPoint => {
131
- if ( ! dataPoint . locationName ) {
131
+ if ( ! dataPoint . locationName || ! dataPoint . locationLatitude || ! dataPoint . locationLongitude ) {
132
132
return ;
133
133
}
134
134
circles . push ( this . createCircle ( dataPoint ) ) ;
You can’t perform that action at this time.
0 commit comments