diff --git a/awx/ui/test/unit/layout.spec.js b/awx/ui/test/unit/layout.unit.js similarity index 94% rename from awx/ui/test/unit/layout.spec.js rename to awx/ui/test/unit/layout.unit.js index 512cfbef50..9e586d5a40 100644 --- a/awx/ui/test/unit/layout.spec.js +++ b/awx/ui/test/unit/layout.unit.js @@ -3,7 +3,6 @@ describe('Components | Layout', () => { let $rootScope; let element; let scope; - let i18n; beforeEach(() => { angular.mock.module('gettext'); @@ -26,19 +25,19 @@ describe('Components | Layout', () => { describe('AtLayoutController', () => { let controller; - beforeEach(()=> { + beforeEach(() => { controller = element.controller('atLayout'); }); it('$scope.$on($stateChangeSuccess) should assign toState name to currentState', () => { - let next = {'name': 'dashboard'}; + const next = { name: 'dashboard' }; $rootScope.$broadcast('$stateChangeSuccess', next); expect(controller.currentState).toBe('dashboard'); }); describe('$root.current_user watcher should assign value to ', () => { beforeEach(() => { - let val = { + const val = { username: 'admin', id: 1 }; @@ -89,11 +88,10 @@ describe('Components | Layout', () => { expect(controller.currentUserId).toBeTruthy(); expect(controller.currentUserId).toBe(1); }); - }); describe('$root.socketStatus watcher should assign newStatus to', () => { - let statuses = ['connecting', 'error', 'ok']; + const statuses = ['connecting', 'error', 'ok']; it('socketState', () => { _.forEach(statuses, (status) => { @@ -128,7 +126,7 @@ describe('Components | Layout', () => { describe('getString()', () => { it('calls ComponentsStrings get() method', angular.mock.inject((_ComponentsStrings_) => { spyOn(_ComponentsStrings_, 'get'); - controller.getString('VIEW_DOCS') + controller.getString('VIEW_DOCS'); expect(_ComponentsStrings_.get).toHaveBeenCalled(); })); @@ -137,7 +135,7 @@ describe('Components | Layout', () => { }); it('should return layout string', () => { - let layoutStrings = { + const layoutStrings = { CURRENT_USER_LABEL: 'Logged in as', VIEW_DOCS: 'View Documentation', LOGOUT: 'Logout', @@ -149,8 +147,8 @@ describe('Components | Layout', () => { }); it('should return default string', () => { - let defaultStrings = { - BRAND_NAME: "AWX" + const defaultStrings = { + BRAND_NAME: 'AWX' }; _.forEach(defaultStrings, (value, key) => { @@ -159,4 +157,4 @@ describe('Components | Layout', () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/awx/ui/test/unit/side-nav-item.spec.js b/awx/ui/test/unit/side-nav-item.unit.js similarity index 90% rename from awx/ui/test/unit/side-nav-item.spec.js rename to awx/ui/test/unit/side-nav-item.unit.js index f605a40e69..ac5631404d 100644 --- a/awx/ui/test/unit/side-nav-item.spec.js +++ b/awx/ui/test/unit/side-nav-item.unit.js @@ -8,8 +8,8 @@ describe('Components | Side Nav Item', () => { angular.mock.module('gettext'); angular.mock.module('I18N'); angular.mock.module('ui.router'); - angular.mock.module('at.lib.services') - angular.mock.module('at.lib.components') + angular.mock.module('at.lib.services'); + angular.mock.module('at.lib.components'); }); beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { @@ -24,7 +24,6 @@ describe('Components | Side Nav Item', () => { })); describe('Side Nav Item Controller', () => { - let LayoutCtrl; let SideNavItem; let SideNavItemCtrl; @@ -34,12 +33,12 @@ describe('Components | Side Nav Item', () => { }); it('layoutVm.currentState watcher should assign isRoute', () => { - let current = {'name': 'dashboard'}; + let current = { name: 'dashboard' }; $rootScope.$broadcast('$stateChangeSuccess', current); scope.$digest(); expect(SideNavItemCtrl.isRoute).toBe(true); - current = {'name': 'inventories'}; + current = { name: 'inventories' }; $rootScope.$broadcast('$stateChangeSuccess', current); scope.$digest(); expect(SideNavItemCtrl.isRoute).toBe(false); diff --git a/awx/ui/test/unit/side-nav.spec.js b/awx/ui/test/unit/side-nav.unit.js similarity index 90% rename from awx/ui/test/unit/side-nav.spec.js rename to awx/ui/test/unit/side-nav.unit.js index 1342e41659..03d0130a96 100644 --- a/awx/ui/test/unit/side-nav.spec.js +++ b/awx/ui/test/unit/side-nav.unit.js @@ -3,7 +3,7 @@ describe('Components | Side Nav', () => { let $rootScope; let element; let scope; - let windowMock = { + const windowMock = { innerWidth: 500 }; @@ -11,7 +11,7 @@ describe('Components | Side Nav', () => { angular.mock.module('gettext'); angular.mock.module('I18N'); angular.mock.module('ui.router'); - angular.mock.module('at.lib.services') + angular.mock.module('at.lib.services'); angular.mock.module('at.lib.components', ($provide) => { $provide.value('$window', windowMock); }); @@ -22,7 +22,7 @@ describe('Components | Side Nav', () => { $rootScope = _$rootScope_; scope = $rootScope.$new(); - element = angular.element(""); + element = angular.element(''); element = $compile(element)(scope); scope.$digest(); })); @@ -59,8 +59,8 @@ describe('Components | Side Nav', () => { it('isExpanded should be false after state change event', () => { sideNavCtrl.isExpanded = true; - let current = { - 'name': 'dashboard' + const current = { + name: 'dashboard' }; $rootScope.$broadcast('$stateChangeSuccess', current); scope.$digest();