mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-13 06:36:28 +00:00
Fix tests
This commit is contained in:
@@ -3,19 +3,13 @@ describe('iD.Connection', function () {
|
||||
|
||||
beforeEach(function () {
|
||||
context = iD();
|
||||
c = new iD.Connection(context);
|
||||
c = new iD.Connection(context, {});
|
||||
});
|
||||
|
||||
it('is instantiated', function () {
|
||||
expect(c).to.be.ok;
|
||||
});
|
||||
|
||||
it('gets/sets url', function () {
|
||||
var new_url = 'http://api06.openstreetmap.org';
|
||||
expect(c.url(new_url)).to.equal(c);
|
||||
expect(c.url()).to.equal(new_url);
|
||||
});
|
||||
|
||||
it('gets/sets user', function () {
|
||||
var user = { name: 'tom' };
|
||||
expect(c.user(user)).to.equal(c);
|
||||
@@ -40,6 +34,24 @@ describe('iD.Connection', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe("#switch", function() {
|
||||
it("changes the URL", function() {
|
||||
c.switch({
|
||||
url: "http://example.com"
|
||||
});
|
||||
expect(c.changesetUrl(1)).to.equal("http://example.com/browse/changeset/1")
|
||||
});
|
||||
|
||||
it("emits an auth event", function(done) {
|
||||
c.on('auth', function() {
|
||||
done();
|
||||
});
|
||||
c.switch({
|
||||
url: "http://example.com"
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#loadFromURL', function () {
|
||||
it('loads test data', function (done) {
|
||||
c.loadFromURL('data/node.xml', done);
|
||||
|
||||
Reference in New Issue
Block a user