mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
add test for adding map data controls
This commit is contained in:
parent
60a4ea3a40
commit
9c700f248e
1 changed files with 19 additions and 0 deletions
|
@ -82,6 +82,25 @@ define(function (require) {
|
|||
expect(map.addBoundingControl.callCount).to.equal(1);
|
||||
});
|
||||
|
||||
it('should only add controls if data exists', function () {
|
||||
var noData = {
|
||||
geoJson: {
|
||||
features: [],
|
||||
properties: {},
|
||||
hits: 20
|
||||
}
|
||||
};
|
||||
var tilemap = createTileMap(null, null, noData);
|
||||
|
||||
tilemap._appendMap($selection);
|
||||
expect(tilemap.maps).to.have.length(1);
|
||||
|
||||
var map = tilemap.maps[0];
|
||||
expect(map.addTitle.callCount).to.equal(0);
|
||||
expect(map.addFitControl.callCount).to.equal(0);
|
||||
expect(map.addBoundingControl.callCount).to.equal(0);
|
||||
});
|
||||
|
||||
it('should append title if set in the data object', function () {
|
||||
var mapTitle = 'Test Title';
|
||||
var tilemap = createTileMap(null, null, _.assign({ title: mapTitle }, geoJsonData));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue