Files
iD/test/spec/ui/flash.js
Quincy Morgan a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00

40 lines
1.2 KiB
JavaScript

describe('iD.uiFlash', function () {
var context;
beforeEach(function() {
var container = d3.select('body');
context = iD.coreContext().init().container(container);
container
.append('div')
.attr('class', 'flash-wrap')
.append('div')
.attr('class', 'main-footer-wrap');
});
afterEach(function() {
d3.select('.flash-wrap')
.remove();
});
it('flash is shown', function() {
iD.uiFlash(context).duration(200)();
var flashWrap = d3.selectAll('.flash-wrap');
var footerWrap = d3.selectAll('.main-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(context).duration(200)();
window.setTimeout(function() {
d3.timerFlush();
var flashWrap = d3.selectAll('.flash-wrap');
var footerWrap = d3.selectAll('.main-footer-wrap');
expect(flashWrap.classed('footer-hide')).to.be.ok;
expect(footerWrap.classed('footer-show')).to.be.ok;
done();
}, 225);
});
});