Resolve final broken tests

This commit is contained in:
Josh Johnson 2017-10-03 13:17:31 +01:00
parent 498e45f6db
commit e96e5fdc74
2 changed files with 4 additions and 14 deletions

View file

@ -96,4 +96,4 @@
"src/**/**/**/**/**/*.spec.js"
]
}
}
}

View file

@ -846,21 +846,11 @@ describe('Choices', () => {
});
it('should handle ajax()', () => {
sinon.spy(instance, 'ajax');
const dummyFn = sinon.spy();
instance.ajax((callback) => {
fetch('https://restcountries.eu/rest/v1/all')
.then((response) => {
response.json().then((data) => {
callback(data, 'alpha2Code', 'name');
});
})
.catch((error) => {
console.log(error);
});
});
instance.ajax(dummyFn);
expect(instance.ajax).to.have.been.called();
expect(dummyFn.callCount).to.equal(1);
});
});