diff --git a/tests/cases/heatmap.js b/tests/cases/heatmap.js index 6bcee71922..458fd3beaf 100644 --- a/tests/cases/heatmap.js +++ b/tests/cases/heatmap.js @@ -1,3 +1,4 @@ +// Test geo.core.osmLayer var geo = require('../test-utils').geo; var $ = require('jquery'); @@ -13,6 +14,10 @@ afterEach(function () { describe('canvas heatmap feature', function () { 'use strict'; + var mockAnimationFrame = require('../test-utils').mockAnimationFrame; + var stepAnimationFrame = require('../test-utils').stepAnimationFrame; + var unmockAnimationFrame = require('../test-utils').unmockAnimationFrame; + var map, width = 800, height = 600, layer, feature1, feature2, testData = "Strength, Lat,Lon\ 0.6,42.8584,-70.9301\ @@ -47,8 +52,11 @@ describe('canvas heatmap feature', function () { .style('blurRadius', 15) .style('opacity', 1.0); + mockAnimationFrame(); map.draw(); - expect(layer.children().length).toBe(1); + stepAnimationFrame(new Date().getTime()); + expect(layer.children().length).toBe(1) + unmockAnimationFrame(); }); it('Validate selection API option', function () {