mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-28 03:22:15 +02:00
Resolve final broken tests
This commit is contained in:
parent
498e45f6db
commit
e96e5fdc74
|
@ -96,4 +96,4 @@
|
||||||
"src/**/**/**/**/**/*.spec.js"
|
"src/**/**/**/**/**/*.spec.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -846,21 +846,11 @@ describe('Choices', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle ajax()', () => {
|
it('should handle ajax()', () => {
|
||||||
sinon.spy(instance, 'ajax');
|
const dummyFn = sinon.spy();
|
||||||
|
|
||||||
instance.ajax((callback) => {
|
instance.ajax(dummyFn);
|
||||||
fetch('https://restcountries.eu/rest/v1/all')
|
|
||||||
.then((response) => {
|
|
||||||
response.json().then((data) => {
|
|
||||||
callback(data, 'alpha2Code', 'name');
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(instance.ajax).to.have.been.called();
|
expect(dummyFn.callCount).to.equal(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue