Fix hash tests

This commit is contained in:
Tom MacWright
2013-03-13 17:56:27 -04:00
parent 2d27f5ebfb
commit b1eef6ad0c
+10 -10
View File
@@ -1,4 +1,4 @@
describe("iD.behavior.Hash", function () {
describe('iD.behavior.Hash', function () {
mocha.globals('__onhashchange.hash');
var hash, context;
@@ -19,16 +19,16 @@ describe("iD.behavior.Hash", function () {
hash.off();
});
it("sets hadHash if location.hash is present", function () {
location.hash = "map=20.00/38.87952/-77.02405";
it('sets hadHash if location.hash is present', function () {
location.hash = 'map=20.00/-77.02405/38.87952';
hash();
expect(hash.hadHash).to.be.true;
});
it("centerZooms map to requested level", function () {
location.hash = "map=20.00/38.87952/-77.02405";
it('centerZooms map to requested level', function () {
location.hash = 'map=20.00/-77.02405/38.87952';
hash();
@@ -37,7 +37,7 @@ describe("iD.behavior.Hash", function () {
expect(context.map().zoom()).to.equal(20.0);
});
it("centerZooms map at requested coordinates on hash change", function (done) {
it('centerZooms map at requested coordinates on hash change', function (done) {
hash();
d3.select(window).on('hashchange', function () {
@@ -48,17 +48,17 @@ describe("iD.behavior.Hash", function () {
done();
});
location.hash = "#map=20.00/38.87952/-77.02405";
location.hash = 'map=20.00/-77.02405/38.87952';
});
it("stores the current zoom and coordinates in location.hash on map move events", function () {
location.hash = "";
it('stores the current zoom and coordinates in location.hash on map move events', function () {
location.hash = '';
hash();
context.map().center([38.9, -77.0]);
context.map().zoom(2.0);
expect(location.hash).to.equal("#map=2.00/-77.0/38.9");
expect(location.hash).to.equal('#map=2.00/38.9/-77.0');
});
});