more tests

This commit is contained in:
Javier Abadia 2013-12-21 00:06:32 +01:00
parent 9bf4371915
commit c24636313c
2 changed files with 18 additions and 0 deletions

View File

@ -90,5 +90,6 @@
<body>
<div id="map" style="position: absolute; bottom: 0; right: 0; height:200px; width: 200px;"></div>
<img src="" alt="" id="fakeTile" style="display:none;">
</body>
</html>

View File

@ -132,4 +132,21 @@ describe("offline enabler library", function()
});
});
async.it("returns placeholder urls when offline", function(done)
{
require(["dojo/dom"], function(dom)
{
var fakeTile = dom.byId('fakeTile');
g_basemapLayer.goOnline();
var onlineUrl = g_basemapLayer.getTileUrl(14,6178,8023);
expect(onlineUrl).toEqual('http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/14/6178/8023');
g_basemapLayer.goOffline();
var offlineUrl = fakeTile.src = g_basemapLayer.getTileUrl(14,6178,8023);
expect(offlineUrl).toEqual('void:14-6178-8023');
done();
})
});
});