Fix code test

This commit is contained in:
Quincy Morgan
2020-03-24 14:12:34 -07:00
parent e17186028a
commit 955b622e1b
2 changed files with 11 additions and 1 deletions
+9
View File
@@ -7,6 +7,15 @@
<link rel='stylesheet' href='../node_modules/mocha/mocha.css'>
<link rel='stylesheet' href='../dist/iD.css'>
<!-- <script src='../node_modules/d3/build/d3.js'></script> -->
<style type='text/css'>
/* apply standalone iD styling when testing */
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body style="overflow:scroll">
+2 -1
View File
@@ -74,7 +74,8 @@ describe('iD.Map', function() {
describe('#center', function() {
it('gets and sets center', function() {
expect(map.center([0, 0])).to.equal(map);
expect(map.center()).to.eql([0, 0]);
expect(map.center()[0]).to.be.closeTo(0, 1e-6);
expect(map.center()[1]).to.be.closeTo(0, 1e-6);
expect(map.center([10, 15])).to.equal(map);
expect(map.center()[0]).to.be.closeTo(10, 1e-6);
expect(map.center()[1]).to.be.closeTo(15, 1e-6);