Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
52
gaia/apps/system/test/unit/mobileid_dialog_test.js
Executable file
52
gaia/apps/system/test/unit/mobileid_dialog_test.js
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
'use strict';
|
||||
|
||||
/* global MobileIdDialog, SystemDialog, LayoutManager, MocksHelper */
|
||||
|
||||
require('/js/service.js');
|
||||
require('/js/base_ui.js');
|
||||
require('/js/system_dialog.js');
|
||||
require('/js/mobileid_dialog.js');
|
||||
require('/test/unit/mock_system_dialog_manager.js');
|
||||
require('/test/unit/mock_layout_manager.js');
|
||||
require('/test/unit/mock_keyboard_manager.js');
|
||||
|
||||
var mocksForMobileIdDialog = new MocksHelper([
|
||||
'SystemDialogManager',
|
||||
'LayoutManager',
|
||||
'KeyboardManager'
|
||||
]).init();
|
||||
|
||||
suite('MobileID Dialog', function() {
|
||||
mocksForMobileIdDialog.attachTestHelpers();
|
||||
|
||||
var container;
|
||||
|
||||
setup(function() {
|
||||
container = document.createElement('div');
|
||||
document.body.appendChild(container);
|
||||
SystemDialog.prototype.containerElement = container;
|
||||
|
||||
window.layoutManager = new LayoutManager();
|
||||
});
|
||||
|
||||
teardown(function() {
|
||||
document.body.removeChild(container);
|
||||
SystemDialog.prototype.containerElement = container = null;
|
||||
|
||||
window.layoutManager = null;
|
||||
});
|
||||
|
||||
test('Dialog should be removed when closed', function() {
|
||||
var that = this;
|
||||
var dialog = new MobileIdDialog({
|
||||
onOpened: function onOpened() {
|
||||
that.sinon.spy(dialog.panel.parentNode, 'removeChild');
|
||||
},
|
||||
onClosed: function onClosed() {
|
||||
assert.isTrue(dialog.panel.parentNode.removeChild.calledOnce);
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
dialog.close();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue