Merge "Fix jasmine test failures due to missing ngRoute, schema-form dep"

This commit is contained in:
Jenkins 2016-09-20 00:40:53 +00:00 committed by Gerrit Code Review
commit e5d467ff1e
6 changed files with 24 additions and 14 deletions

View File

@ -97,16 +97,28 @@
describe('WEBROOT handling', function() { describe('WEBROOT handling', function() {
it('respects WEBROOT by default', function() { it('respects WEBROOT by default', function() {
var expectedUrl = WEBROOT + 'good'; var expectedUrl = WEBROOT + 'good';
var $scope = {};
$httpBackend.when('GET', expectedUrl).respond(200, ''); $httpBackend.when('GET', expectedUrl).respond(200, '');
$httpBackend.expect('GET', expectedUrl); $httpBackend.expect('GET', expectedUrl);
api.get('/good'); api.get('/good').success(function() {
$scope.success = true;
});
$httpBackend.flush();
expect($scope.success).toBe(true);
}); });
it('ignores WEBROOT with external = true flag', function() { it('ignores WEBROOT with external = true flag', function() {
var expectedUrl = '/good'; var expectedUrl = '/good';
var $scope = {};
$httpBackend.when('GET', expectedUrl).respond(200, ''); $httpBackend.when('GET', expectedUrl).respond(200, '');
$httpBackend.expect('GET', expectedUrl); $httpBackend.expect('GET', expectedUrl);
api.get('/good', {external: true}); api.get('/good', {external: true}).success(function() {
$scope.success = true;
});
$httpBackend.flush();
expect($scope.success).toBe(true);
}); });
}); });

View File

@ -31,9 +31,6 @@
expect(angular.module('schemaForm')).toBeDefined(); expect(angular.module('schemaForm')).toBeDefined();
}); });
it('should build tabs correctly', function() {
});
it('should define messages for all the error codes', function() { it('should define messages for all the error codes', function() {
// We don't need to check the specifics of each message in a test, // We don't need to check the specifics of each message in a test,
// but we should check they all exist // but we should check they all exist

View File

@ -29,9 +29,6 @@
<script src='{{ STATIC_URL }}{{ file }}'></script> <script src='{{ STATIC_URL }}{{ file }}'></script>
{% endfor %} {% endfor %}
<!-- Magic Search library must be after magic-search override widget -->
<script src="{{ STATIC_URL }}horizon/lib/magic_search/magic_search.js"></script>
{% block source %} {% block source %}
{% endblock %} {% endblock %}

View File

@ -24,8 +24,9 @@
* Dashboard module for the resource-browser panel. * Dashboard module for the resource-browser panel.
*/ */
angular angular
.module('horizon.dashboard.developer.resource-browser', [], config) .module('horizon.dashboard.developer.resource-browser', ['ngRoute', 'schemaForm'], config)
.constant('horizon.dashboard.developer.resource-browser.BASE_ROUTE', 'developer/resource_browser/'); .constant('horizon.dashboard.developer.resource-browser.BASE_ROUTE',
'developer/resource_browser/');
config.$inject = [ config.$inject = [
'$windowProvider', '$windowProvider',

View File

@ -225,6 +225,9 @@
var modalArgs = wizardModalService.modal.calls.argsFor(0)[0]; var modalArgs = wizardModalService.modal.calls.argsFor(0)[0];
modalArgs.submit(); modalArgs.submit();
$scope.$apply(); $scope.$apply();
expect($scope.$emit).toHaveBeenCalledWith(
'horizon.app.core.images.IMAGE_METADATA_CHANGED', undefined);
}); });
it('should destroy the event watchers', function() { it('should destroy the event watchers', function() {