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/callscreen/test/unit/index_test.js
Executable file
52
gaia/apps/callscreen/test/unit/index_test.js
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
/* globals onLoadCallScreen, MockKeypadManager,
|
||||
MocksHelper, unloadCallScreen */
|
||||
|
||||
'use strict';
|
||||
|
||||
require('/shared/test/unit/mocks/dialer/mock_calls_handler.js');
|
||||
require('/shared/test/unit/mocks/dialer/mock_keypad.js');
|
||||
|
||||
require('/test/unit/mock_call_screen.js');
|
||||
|
||||
var mocksHelperForIndex = new MocksHelper([
|
||||
'CallScreen',
|
||||
'CallsHandler',
|
||||
'KeypadManager'
|
||||
]).init();
|
||||
|
||||
suite('index.js', function() {
|
||||
mocksHelperForIndex.attachTestHelpers();
|
||||
|
||||
setup(function(done) {
|
||||
this.sinon.spy(window, 'addEventListener');
|
||||
|
||||
require('/js/index.js', done);
|
||||
});
|
||||
|
||||
teardown(function() {
|
||||
window.removeEventListener('load', onLoadCallScreen);
|
||||
window.removeEventListener('unload', unloadCallScreen);
|
||||
});
|
||||
|
||||
suite('loading', function() {
|
||||
test('onload/onunload handlers are properly registered', function() {
|
||||
sinon.assert.calledWith(window.addEventListener, 'load',
|
||||
onLoadCallScreen);
|
||||
sinon.assert.calledWith(window.addEventListener, 'unload',
|
||||
unloadCallScreen);
|
||||
});
|
||||
});
|
||||
|
||||
suite('initialization', function() {
|
||||
setup(function() {
|
||||
this.sinon.spy(MockKeypadManager, 'init');
|
||||
|
||||
onLoadCallScreen();
|
||||
});
|
||||
|
||||
test('all components are initialized with the proper parameters',
|
||||
function() {
|
||||
sinon.assert.calledWith(MockKeypadManager.init, /* oncall */ true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue