This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Bug 1059488 - [MobileID] Country code manual selection dialog seems b…
…roken. r=alive Conflicts: apps/system/js/mobileid_dialog.js
- Loading branch information
1 parent
4627014
commit b821580
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict'; | ||
|
||
/* global MobileIdDialog, SystemDialog, LayoutManager, MocksHelper */ | ||
|
||
require('/js/system.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'); | ||
require('/test/unit/mock_statusbar.js'); | ||
|
||
var mocksForMobileIdDialog = new MocksHelper([ | ||
'SystemDialogManager', | ||
'LayoutManager', | ||
'KeyboardManager', | ||
'StatusBar' | ||
]).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(); | ||
}); | ||
}); |