Skip to content

Instantly share code, notes, and snippets.

@EragonJ
Created February 13, 2015 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EragonJ/1578818c090a9f2ea77a to your computer and use it in GitHub Desktop.
Save EragonJ/1578818c090a9f2ea77a to your computer and use it in GitHub Desktop.
diff --git a/apps/settings/test/unit/icc_test.js b/apps/settings/test/unit/icc_test.js
index a6bd1d8..fc0194c 100644
--- a/apps/settings/test/unit/icc_test.js
+++ b/apps/settings/test/unit/icc_test.js
@@ -62,13 +62,6 @@ suite('STK (App menu) >', function() {
mocksHelper = new MocksHelper(mocksForIccApp);
mocksHelper.suiteSetup();
- HtmlImports.populate(function() {
- window.addEventListener('iccPageLoaded', function onLoaded(event) {
- done();
- });
- requireApp('settings/js/icc.js');
- });
-
this.STK_NEXT_ACTION_INDICATOR = {
16: 'stkItemsNaiSetUpCall',
17: 'stkItemsNaiSendSs',
@@ -177,6 +170,24 @@ suite('STK (App menu) >', function() {
}
}
}}});
+
+ HtmlImports.populate(function() {
+ var map = {
+ 'shared/stk_helper': 'shared_mocks/mock_stk_helper'
+ };
+
+ testRequire([
+ 'shared_mocks/mock_stk_helper'
+ ], map, function(MockStkHelper) {
+ // we have to replace `require` in icc.js
+ window.require = function(modules, callback) {
+ callback(MockStkHelper);
+ };
+ testRequire(['icc'], {}, function() {
+ done();
+ });
+ });
+ });
});
suiteTeardown(function() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment