mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Previously it was up to the caller to draw whatever they want into the footer flash. With this change, uiFlash creates an icon and a text, so the caller doesn't need to do as much work.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
describe('iD.uiFlash', function () {
|
|
|
|
beforeEach(function() {
|
|
d3.select('body')
|
|
.append('div')
|
|
.attr('id', 'flash-wrap')
|
|
.append('div')
|
|
.attr('id', 'footer-wrap');
|
|
});
|
|
|
|
afterEach(function() {
|
|
d3.select('#flash-wrap')
|
|
.remove();
|
|
});
|
|
|
|
it('flash is shown', function() {
|
|
iD.uiFlash().duration(200)();
|
|
var flashWrap = d3.selectAll('#flash-wrap');
|
|
var footerWrap = d3.selectAll('#footer-wrap');
|
|
expect(flashWrap.classed('footer-show')).to.be.ok;
|
|
expect(footerWrap.classed('footer-hide')).to.be.ok;
|
|
});
|
|
|
|
it('flash goes away', function(done) {
|
|
iD.uiFlash().duration(200)();
|
|
window.setTimeout(function() {
|
|
d3.timerFlush();
|
|
var flashWrap = d3.selectAll('#flash-wrap');
|
|
var footerWrap = d3.selectAll('#footer-wrap');
|
|
expect(flashWrap.classed('footer-hide')).to.be.ok;
|
|
expect(footerWrap.classed('footer-show')).to.be.ok;
|
|
done();
|
|
}, 225);
|
|
});
|
|
|
|
});
|