feat(core): Modify core module to implement style guidelines.

Update the core module to implement the style guidelines.
Reduce size of init.js - moved filter logic out to it's own config.
Rename Menus to menuService
This commit is contained in:
Ryan Hutchison
2016-02-11 00:20:17 -05:00
committed by Ryan Hutchison
parent 59e6daa63d
commit b2462ec86c
28 changed files with 613 additions and 536 deletions

View File

@@ -16,48 +16,45 @@
$state = _$state_;
Authentication = _Authentication_;
HeaderController = $controller('HeaderController', {
HeaderController = $controller('HeaderController as vm', {
$scope: scope
});
}));
it('should expose the authentication service', function () {
expect(scope.authentication).toBe(Authentication);
});
it('should expose the $state service', function () {
expect(scope.$state).toBe($state);
expect(scope.vm.authentication).toBe(Authentication);
});
it('should default menu to collapsed', function () {
expect(scope.isCollapsed).toBeFalsy();
expect(scope.vm.isCollapsed).toBeFalsy();
});
describe('when toggleCollapsibleMenu', function () {
var defaultCollapse;
beforeEach(function () {
defaultCollapse = scope.isCollapsed;
scope.toggleCollapsibleMenu();
defaultCollapse = scope.vm.isCollapsed;
scope.vm.isCollapsed = !scope.vm.isCollapsed;
});
it('should toggle isCollapsed to non default value', function () {
expect(scope.isCollapsed).not.toBe(defaultCollapse);
expect(scope.vm.isCollapsed).not.toBe(defaultCollapse);
});
it('should then toggle isCollapsed back to default value', function () {
scope.toggleCollapsibleMenu();
expect(scope.isCollapsed).toBe(defaultCollapse);
scope.vm.isCollapsed = !scope.vm.isCollapsed;
expect(scope.vm.isCollapsed).toBe(defaultCollapse);
});
});
describe('when view state changes', function () {
beforeEach(function () {
scope.isCollapsed = true;
scope.vm.isCollapsed = true;
scope.$broadcast('$stateChangeSuccess');
});
it('should set isCollapsed to false', function () {
expect(scope.isCollapsed).toBeFalsy();
expect(scope.vm.isCollapsed).toBeFalsy();
});
});
});