diff --git a/awx/ui/tests/spec/license/license.controller-test.js b/awx/ui/tests/spec/license/license.controller-test.js index 060fcd5b58..d2bde80536 100644 --- a/awx/ui/tests/spec/license/license.controller-test.js +++ b/awx/ui/tests/spec/license/license.controller-test.js @@ -5,7 +5,8 @@ describe('Controller: LicenseController', () => { let scope, LicenseController, ConfigService, - ProcessErrors; + ProcessErrors, + config; beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('license', ($provide) => { @@ -14,40 +15,33 @@ describe('Controller: LicenseController', () => { 'delete' ]); - ConfigService.getConfig.and.returnValue({ - then: function(callback){ - return callback({ - license_info: { - time_remaining: 1234567 // seconds - }, - version: '3.1.0-devel' - }); - } - }); + config = { + license_info: { + time_remaining: 1234567 // seconds + }, + version: '3.1.0-devel' + }; ProcessErrors = jasmine.createSpy('ProcessErrors'); $provide.value('ConfigService', ConfigService); $provide.value('ProcessErrors', ProcessErrors); + $provide.value('config', config); })); - beforeEach(angular.mock.inject( ($rootScope, $controller, _ConfigService_, _ProcessErrors_) => { + beforeEach(angular.mock.inject( ($rootScope, $controller, _ConfigService_, _ProcessErrors_, _config_) => { scope = $rootScope.$new(); ConfigService = _ConfigService_; ProcessErrors = _ProcessErrors_; + config = _config_; LicenseController = $controller('licenseController', { $scope: scope, ConfigService: ConfigService, - ProcessErrors: ProcessErrors + ProcessErrors: ProcessErrors, + config: config }); })); - // Suites - it('should GET a config object on initialization', ()=>{ - expect(ConfigService.delete).toHaveBeenCalled(); - expect(ConfigService.getConfig).toHaveBeenCalled(); - }); - xit('should show correct expiration date', ()=>{ let date = new Date(), options = {