Add a file in karma.conf to pass js tests

This patch add a simple js test for a module which is
using horizon module as a example.
To pass this test, we need to add a file for horizon.

Change-Id: I345b931f22619e9e700c4c1623aceabdae7d0dd4
This commit is contained in:
Kenji Ishii 2016-09-15 15:22:08 +09:00
parent 48ee56ecc1
commit 1d89f59e26
2 changed files with 37 additions and 0 deletions

View File

@ -65,6 +65,8 @@ module.exports = function (config) {
toxPath + 'xstatic/pkg/tv4/data/tv4.js',
toxPath + 'xstatic/pkg/objectpath/data/ObjectPath.js',
toxPath + 'xstatic/pkg/angular_schema_form/data/schema-form.js',
toxPath + 'xstatic/pkg/angular_fileupload/data/ng-file-upload.js',
// TODO: These should be mocked.
toxPath + '/horizon/static/horizon/js/horizon.js',

View File

@ -0,0 +1,35 @@
/*
* (c) Copyright 2016 NEC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function() {
'use strict';
describe('Magnum API', function() {
var service;
beforeEach(module('horizon.framework'));
beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(inject(['horizon.app.core.openstack-service-api.magnum', function(magnumAPI) {
service = magnumAPI;
}]));
it('defines the service', function() {
expect(service).toBeDefined();
});
});
})();