Skip to content

Commit a2eb6bb

Browse files
committed
add test case for US Virgin Islands country name -> ISO3
1 parent ee7de47 commit a2eb6bb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/jasmine/tests/geo_test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,25 @@ describe('geojson / topojson utils', function() {
380380
expect(out).toEqual(false);
381381
});
382382
});
383+
384+
describe('should distinguish between US and US Virgin Island', function() {
385+
386+
// N.B. Virgin Island don't appear at the 'world_110m' resolution
387+
var topojsonName = 'world_50m';
388+
var topojson = GeoAssets.topojson[topojsonName];
389+
390+
var shouldPass = [
391+
'Virgin Islands (U.S.)',
392+
' Virgin Islands (U.S.) '
393+
];
394+
395+
shouldPass.forEach(function(str) {
396+
it('(case ' + str + ')', function() {
397+
var out = _locationToFeature(topojson, str, 'country names');
398+
expect(out.id).toEqual('VIR');
399+
});
400+
});
401+
});
383402
});
384403

385404
describe('Test geo interactions', function() {

0 commit comments

Comments
 (0)