Adding tests for ng identity basePath constant

This patch improves test coverage for the agular identity
dashboard by adding tests for the basePath constant definition.
A minor consistency issue in the module file is also addressed.

Change-Id: I97d0ce728e44777635bf6590e312fb00d1684582
Partially-Implements: blueprint angularize-identity-tables
This commit is contained in:
Paulo Ewerton 2015-09-09 14:26:18 +00:00 committed by Paulo Ewerton Gomes Fragoso
parent 03b4c9ffb8
commit 859195d44c
2 changed files with 18 additions and 1 deletions

View File

@ -31,7 +31,10 @@
])
.config(config);
config.$inject = ['$provide', '$windowProvider'];
config.$inject = [
'$provide',
'$windowProvider'
];
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/identity/';

View File

@ -22,4 +22,18 @@
});
});
describe('horizon.dashboard.identity.basePath constant', function() {
var identityBasePath, staticUrl;
beforeEach(module('horizon.dashboard.identity'));
beforeEach(inject(function($injector) {
identityBasePath = $injector.get('horizon.dashboard.identity.basePath');
staticUrl = $injector.get('$window').STATIC_URL;
}));
it('should equal to "/static/dashboard/identity/"', function() {
expect(identityBasePath).toEqual(staticUrl + 'dashboard/identity/');
});
});
})();