mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-17 00:26:08 +00:00
sinon.useFakeTimers mocks setInterval, setTimeout, etc, but not requestAnimationFrame, which d3 transitions rely on.
29 lines
657 B
JavaScript
29 lines
657 B
JavaScript
describe('iD.uiFlash', function () {
|
|
var elem;
|
|
|
|
beforeEach(function() {
|
|
elem = d3.select('body')
|
|
.append('div')
|
|
.attr('id', 'flash');
|
|
});
|
|
|
|
afterEach(function () {
|
|
elem.remove();
|
|
});
|
|
|
|
it('creates a flash', function () {
|
|
iD.uiFlash();
|
|
expect(elem.selectAll('#flash .content').size()).to.eql(1);
|
|
});
|
|
|
|
it.skip('flash goes away', function (done) {
|
|
// test doesn't work on PhantomJS
|
|
iD.uiFlash();
|
|
window.setTimeout(function() {
|
|
expect(elem.selectAll('#flash .content').size()).to.eql(0);
|
|
done();
|
|
}, 1900);
|
|
});
|
|
|
|
});
|