New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem to load the template file. #2

Open
wants to merge 1 commit into
base: v2/fix-problem-load-translation-file
from
Jump to file or symbol
Failed to load files and symbols.
+19 −4
Diff settings

Always

Just for now

@@ -12,4 +12,16 @@ window.mockTranslateLoader = (function () {
$translateProvider.useLoader('customLoader');
};
})();
window.mockViewsLoader = (function () {
'use strict';
return function(respond) {
respond = respond ? respond : jasmine.any(String);
inject(function ($httpBackend) {
var pathView = /^views.*\.html$/;
$httpBackend.when('GET', pathView).respond(respond);
});
};
})();
@@ -20,14 +20,17 @@
globalLayer.setContent(el);
});
it('should give the same element that the content of file gives at setContentFromLayout', function () {
it('should give the same element that the content of file gives at setContentFromLayout', inject(function ($httpBackend, $compile) {
window.mockViewsLoader('<div></div>');
rootScope.$on(globalLayer.EVENT_NAME_SET_CONTENT, function (event, datas) {
// fix after
expect(datas.el).toEqual('???');
var scopeCompile = rootScope.$new();
var elToTest = $compile(angular.element('<div>'))(scopeCompile);
expect(datas.el).toEqual(elToTest);
});
globalLayer.setContentFromLayout('views/globalLayer/connection.html');
// to resolve the $templateRequest promise.
rootScope.$digest();
});
$httpBackend.flush();
}));
});
})();
ProTip! Use n and p to navigate between commits in a pull request.