Files
iD/test/spec/ui/flash.js
Bryan Housel c18cc7577d Add flash test, avoid using sinon.useFakeTimers in tests.
sinon.useFakeTimers mocks setInterval, setTimeout, etc,
but not requestAnimationFrame, which d3 transitions rely on.
2017-02-11 00:19:49 -05:00

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);
});
});