update tests

This commit is contained in:
Juan Thomassie 2015-05-08 12:09:09 -05:00
parent 5ace38c68f
commit 6ddd9f202c
2 changed files with 4 additions and 8 deletions

View file

@ -457,7 +457,7 @@ define(function (require) {
*/
TileMap.prototype.addLegend = function (data, map) {
var self = this;
var isLegend = $(this.chartEl).find('div.tilemap-legend').length;
var isLegend = $('div.tilemap-legend', this.chartEl).length;
if (isLegend) return; // Don't add Legend if already one

View file

@ -201,7 +201,7 @@ define(function (require) {
it('should return an object', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isObject(chart.getMinMax(data))).to.be(true);
expect(chart.getMinMax(data)).to.be.an(Object);
});
});
@ -209,9 +209,7 @@ define(function (require) {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
var min = _.chain(data.geoJson.features)
.map(function (n) {
return n.properties.count;
})
.deepPluck('properties.count')
.min()
.value();
expect(chart.getMinMax(data).min).to.be(min);
@ -222,9 +220,7 @@ define(function (require) {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
var max = _.chain(data.geoJson.features)
.map(function (n) {
return n.properties.count;
})
.deepPluck('properties.count')
.max()
.value();
expect(chart.getMinMax(data).max).to.be(max);