mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-06 23:56:34 +02:00
Resolve final broken tests
This commit is contained in:
parent
498e45f6db
commit
e96e5fdc74
|
@ -96,4 +96,4 @@
|
|||
"src/**/**/**/**/**/*.spec.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue