[Code Style] Run gulp fixstyle

...to apply code style settings from #142.
This commit is contained in:
Victor Woeltjen
2016-05-19 11:29:13 -07:00
parent f12b9704d9
commit fa77139077
440 changed files with 1885 additions and 1662 deletions

View File

@@ -47,7 +47,7 @@ define(
mockPlainDocument =
jasmine.createSpyObj("document", ["createElement"]);
mockDocument = [ mockPlainDocument ];
mockDocument = [mockPlainDocument];
mockDocument.find = jasmine.createSpy("$document.find");
mockHead = jasmine.createSpyObj("head", ["append"]);
mockElement = jasmine.createSpyObj("link", ["setAttribute"]);

View File

@@ -92,4 +92,4 @@ define(
});
});
}
);
);

View File

@@ -35,11 +35,13 @@ define(
beforeEach(function () {
mockIndicator = jasmine.createSpyObj(
"indicator",
[ "getGlyph", "getText" ]
["getGlyph", "getText"]
);
testIndicatorA = {};
testIndicatorB = function () { return mockIndicator; };
testIndicatorB = function () {
return mockIndicator;
};
testIndicatorC = { template: "someTemplate" };
testIndicators = [
@@ -71,4 +73,4 @@ define(
});
});
}
);
);

View File

@@ -32,7 +32,7 @@ define(
beforeEach(function () {
mockDocument = jasmine.createSpyObj(
"$document",
[ "on", "off" ]
["on", "off"]
);
mockTimeout = jasmine.createSpy('timeout');
controller = new ClickAwayController(

View File

@@ -57,4 +57,4 @@ define(
});
});
}
);
);

View File

@@ -48,7 +48,7 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
"$scope",
[ "$apply", "$watch", "$watchCollection" ]
["$apply", "$watch", "$watchCollection"]
);
mockScope.ngModel = {};
mockScope.field = "testField";

View File

@@ -80,4 +80,4 @@ define(
});
}
);
);

View File

@@ -39,35 +39,35 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
"$scope",
[ "$watch" ]
["$watch"]
);
mockScope.ngModel = {};
mockScope.ngModel.selectedObject = 'mock selected object';
mockObjectService = jasmine.createSpyObj(
"objectService",
[ "getObjects" ]
["getObjects"]
);
mockPromise = jasmine.createSpyObj(
"promise",
[ "then" ]
["then"]
);
mockObjectService.getObjects.andReturn(mockPromise);
mockDomainObject = jasmine.createSpyObj(
"selectedObject",
[ "hasCapability", "getCapability", "useCapability", "getModel" ]
["hasCapability", "getCapability", "useCapability", "getModel"]
);
mockDomainObject.getModel.andReturn({location: 'somewhere'});
mockDomainObject.hasCapability.andReturn(true);
mockContextCapability = jasmine.createSpyObj(
"context capability",
[ "getParent" ]
["getParent"]
);
mockLocationCapability = jasmine.createSpyObj(
"location capability",
[ "isLink" ]
["isLink"]
);
mockDomainObject.getCapability.andCallFake(function (param) {
if (param === 'location') {
@@ -76,9 +76,9 @@ define(
return mockContextCapability;
}
});
controller = new ObjectInspectorController(mockScope, mockObjectService);
// Change the selected object to trigger the watch call
mockScope.ngModel.selectedObject = mockDomainObject;
});
@@ -94,17 +94,17 @@ define(
it("if link, looks for primary parent objects", function () {
mockLocationCapability.isLink.andReturn(true);
mockScope.$watch.mostRecentCall.args[1]();
expect(mockDomainObject.getModel).toHaveBeenCalled();
expect(mockObjectService.getObjects).toHaveBeenCalled();
mockPromise.then.mostRecentCall.args[0]({'somewhere': mockDomainObject});
});
it("gets metadata", function () {
mockScope.$watch.mostRecentCall.args[1]();
expect(mockDomainObject.useCapability).toHaveBeenCalledWith('metadata');
});
});
}
);
);

View File

@@ -43,7 +43,7 @@ define(
function makeMockObject(id) {
var mockObject = jasmine.createSpyObj(
'object-' + id,
[ 'getId' ]
['getId']
);
mockObject.getId.andReturn(id);
return mockObject;
@@ -60,15 +60,15 @@ define(
);
mockDomainObject = jasmine.createSpyObj(
'domainObject',
[ 'getCapability', 'hasCapability' ]
['getCapability', 'hasCapability']
);
mockType = jasmine.createSpyObj(
'type',
[ 'instanceOf' ]
['instanceOf']
);
mockDomainObjects = {};
[ "ROOT", "abc", "def", "xyz" ].forEach(function (id) {
["ROOT", "abc", "def", "xyz"].forEach(function (id) {
mockDomainObjects[id] = makeMockObject(id);
});
@@ -98,7 +98,7 @@ define(
});
it("watches for changes in controlled property", function () {
var testValue = [ "a", "b", 1, 2 ];
var testValue = ["a", "b", 1, 2];
// This test is sensitive to ordering of watch calls
expect(mockScope.$watchCollection.calls.length).toEqual(1);
// Make sure we're watching the correct object
@@ -131,7 +131,7 @@ define(
});
it("loads objects when the underlying list changes", function () {
var testIds = [ "abc", "def", "xyz" ];
var testIds = ["abc", "def", "xyz"];
// This test is sensitive to ordering of watch calls
expect(mockScope.$watchCollection.calls.length).toEqual(1);
// Make sure we're watching the correct object

View File

@@ -56,16 +56,16 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
"$scope",
[ "$apply", "$watch", "$watchCollection" ]
["$apply", "$watch", "$watchCollection"]
);
mockFormatService = jasmine.createSpyObj(
"formatService",
[ "getFormat" ]
["getFormat"]
);
testDefaultFormat = 'utc';
mockFormat = jasmine.createSpyObj(
"format",
[ "validate", "format", "parse" ]
["validate", "format", "parse"]
);
mockFormatService.getFormat.andReturn(mockFormat);

View File

@@ -59,4 +59,4 @@ define(
});
}
);
);

View File

@@ -32,7 +32,9 @@ define(
function TestObject(id, context) {
return {
getId: function () { return id; },
getId: function () {
return id;
},
getCapability: function (key) {
return key === 'context' ? context : undefined;
}
@@ -44,7 +46,7 @@ define(
mockTimeout = jasmine.createSpy("$timeout");
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "getModel", "useCapability" ]
["getId", "getCapability", "getModel", "useCapability"]
);
controller = new TreeNodeController(mockScope, mockTimeout);
@@ -71,7 +73,7 @@ define(
// This is needed to highlight the current selection
var mockContext = jasmine.createSpyObj(
"context",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
obj = new TestObject("test-object", mockContext);
@@ -92,11 +94,11 @@ define(
it("expands a node if it is on the navigation path", function () {
var mockParentContext = jasmine.createSpyObj(
"parentContext",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
mockChildContext = jasmine.createSpyObj(
"childContext",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
parent = new TestObject("parent", mockParentContext),
child = new TestObject("child", mockChildContext);
@@ -128,11 +130,11 @@ define(
it("does not expand a node if it is not on the navigation path", function () {
var mockParentContext = jasmine.createSpyObj(
"parentContext",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
mockChildContext = jasmine.createSpyObj(
"childContext",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
parent = new TestObject("parent", mockParentContext),
child = new TestObject("child", mockChildContext);
@@ -161,11 +163,11 @@ define(
it("does not expand a node if no context is available", function () {
var mockParentContext = jasmine.createSpyObj(
"parentContext",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
mockChildContext = jasmine.createSpyObj(
"childContext",
[ "getParent", "getPath", "getRoot" ]
["getParent", "getPath", "getRoot"]
),
parent = new TestObject("parent", mockParentContext),
child = new TestObject("child", undefined);

View File

@@ -33,9 +33,11 @@ define(
controller;
beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", [ "$watch" ]);
mockScope = jasmine.createSpyObj("$scope", ["$watch"]);
mockTimeout = jasmine.createSpy("$timeout");
mockTimeout.andCallFake(function (cb) { cb(); });
mockTimeout.andCallFake(function (cb) {
cb();
});
mockScope.ngModel = {};
controller = new ViewSwitcherController(mockScope, mockTimeout);
});
@@ -108,4 +110,4 @@ define(
});
}
);
);

View File

@@ -24,7 +24,7 @@ define(
["../../src/directives/MCTClickElsewhere"],
function (MCTClickElsewhere) {
var JQLITE_METHODS = [ "on", "off", "find", "parent" ];
var JQLITE_METHODS = ["on", "off", "find", "parent"];
describe("The mct-click-elsewhere directive", function () {
var mockDocument,
@@ -48,7 +48,7 @@ define(
mockDocument =
jasmine.createSpyObj("$document", JQLITE_METHODS);
mockScope =
jasmine.createSpyObj("$scope", [ "$eval", "$apply", "$on" ]);
jasmine.createSpyObj("$scope", ["$eval", "$apply", "$on"]);
mockElement =
jasmine.createSpyObj("element", JQLITE_METHODS);
mockBody =

View File

@@ -35,7 +35,7 @@ define(
bundle: { path: "x", resources: "y" },
template: "<span>bar</span>",
key: "xyz",
attributes: [ "someAttr", "someOtherAttr" ]
attributes: ["someAttr", "someOtherAttr"]
}
],
mctContainer;
@@ -85,4 +85,4 @@ define(
});
}
);
);

View File

@@ -24,7 +24,7 @@ define(
["../../src/directives/MCTDrag"],
function (MCTDrag) {
var JQLITE_METHODS = [ "on", "off", "find" ];
var JQLITE_METHODS = ["on", "off", "find"];
describe("The mct-drag directive", function () {
var mockDocument,
@@ -46,7 +46,7 @@ define(
mockDocument =
jasmine.createSpyObj("$document", JQLITE_METHODS);
mockScope =
jasmine.createSpyObj("$scope", [ "$eval", "$apply" ]);
jasmine.createSpyObj("$scope", ["$eval", "$apply"]);
mockElement =
jasmine.createSpyObj("element", JQLITE_METHODS);
mockBody =

View File

@@ -24,7 +24,7 @@ define(
["../../src/directives/MCTPopup"],
function (MCTPopup) {
var JQLITE_METHODS = [ "on", "off", "find", "parent", "css", "append" ];
var JQLITE_METHODS = ["on", "off", "find", "parent", "css", "append"];
describe("The mct-popup directive", function () {
var mockCompile,
@@ -48,7 +48,7 @@ define(
mockPopup =
jasmine.createSpyObj("popup", ["dismiss"]);
mockScope =
jasmine.createSpyObj("$scope", [ "$eval", "$apply", "$on" ]);
jasmine.createSpyObj("$scope", ["$eval", "$apply", "$on"]);
mockElement =
jasmine.createSpyObj("element", JQLITE_METHODS);
mockBody =
@@ -98,7 +98,7 @@ define(
it("displays as a popup", function () {
expect(mockPopupService.display).toHaveBeenCalledWith(
mockNewElement,
[ testRect.left, testRect.top ]
[testRect.left, testRect.top]
);
});

View File

@@ -112,4 +112,4 @@ define(
});
}
);
);

View File

@@ -203,4 +203,4 @@ define(
});
}
);
);

View File

@@ -48,16 +48,16 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
'$scope',
[ '$on', '$watch' ]
['$on', '$watch']
);
mockElement = jasmine.createSpyObj(
'element',
[ 'addClass' ]
['addClass']
);
testAttrs = {};
mockSplitPane = jasmine.createSpyObj(
'mctSplitPane',
[ 'position', 'toggleClass', 'anchor' ]
['position', 'toggleClass', 'anchor']
);
mctSplitter.link(
@@ -92,7 +92,7 @@ define(
});
it("repositions during drag", function () {
mockScope.splitter.move([ 10, 0 ]);
mockScope.splitter.move([10, 0]);
expect(mockSplitPane.position)
.toHaveBeenCalledWith(testPosition + 10);
});

View File

@@ -32,7 +32,7 @@ define([
beforeEach(function () {
mockGestureService = jasmine.createSpyObj(
'gestureService',
[ 'attachGestures' ]
['attachGestures']
);
mockParse = jasmine.createSpy('$parse');
mockExpr = jasmine.createSpy('expr');

View File

@@ -33,9 +33,9 @@ define(
popupService;
beforeEach(function () {
mockDocument = jasmine.createSpyObj('$document', [ 'find' ]);
mockDocument = jasmine.createSpyObj('$document', ['find']);
testWindow = { innerWidth: 1000, innerHeight: 800 };
mockBody = jasmine.createSpyObj('body', [ 'append' ]);
mockBody = jasmine.createSpyObj('body', ['append']);
mockElement = jasmine.createSpyObj('element', [
'css',
'remove'
@@ -49,13 +49,13 @@ define(
});
it("adds elements to the body of the document", function () {
popupService.display(mockElement, [ 0, 0 ]);
popupService.display(mockElement, [0, 0]);
expect(mockBody.append).toHaveBeenCalledWith(mockElement);
});
describe("when positioned in appropriate quadrants", function () {
it("orients elements relative to the top-left", function () {
popupService.display(mockElement, [ 25, 50 ]);
popupService.display(mockElement, [25, 50]);
expect(mockElement.css).toHaveBeenCalledWith({
position: 'absolute',
left: '25px',
@@ -64,7 +64,7 @@ define(
});
it("orients elements relative to the top-right", function () {
popupService.display(mockElement, [ 800, 50 ]);
popupService.display(mockElement, [800, 50]);
expect(mockElement.css).toHaveBeenCalledWith({
position: 'absolute',
right: '200px',
@@ -73,7 +73,7 @@ define(
});
it("orients elements relative to the bottom-right", function () {
popupService.display(mockElement, [ 800, 650 ]);
popupService.display(mockElement, [800, 650]);
expect(mockElement.css).toHaveBeenCalledWith({
position: 'absolute',
right: '200px',
@@ -82,7 +82,7 @@ define(
});
it("orients elements relative to the bottom-left", function () {
popupService.display(mockElement, [ 120, 650 ]);
popupService.display(mockElement, [120, 650]);
expect(mockElement.css).toHaveBeenCalledWith({
position: 'absolute',
left: '120px',

View File

@@ -32,7 +32,7 @@ define(
beforeEach(function () {
mockElement =
jasmine.createSpyObj('element', [ 'css', 'remove' ]);
jasmine.createSpyObj('element', ['css', 'remove']);
testStyles = { left: '12px', top: '14px' };
popup = new Popup(mockElement, testStyles);
});

View File

@@ -36,19 +36,19 @@ define(
testViews;
beforeEach(function () {
// Creates a mockLocation, used to
// Creates a mockLocation, used to
// do the view search
mockLocation = jasmine.createSpyObj(
"$location",
[ "path", "search" ]
["path", "search"]
);
// The mockDomainObject is initialized as a
// The mockDomainObject is initialized as a
// spy object to ultimately be passed into the
// urlService urlFor function
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "getModel", "useCapability" ]
["getId", "getCapability", "getModel", "useCapability"]
);
mockContext = jasmine.createSpyObj('context', ['getPath']);
testViews = [
@@ -57,39 +57,39 @@ define(
{ key: 'xyz' }
];
mockMode = "browse";
// The mockContext is set a path
// for the mockDomainObject
mockContext.getPath.andReturn(
[mockDomainObject]
);
// view capability used with the testviews made
mockDomainObject.useCapability.andCallFake(function (c) {
return (c === 'view') && testViews;
});
// context capability used with the mockContext created
// so the variables including context in the urlFor are
// initialized and reached
mockDomainObject.getCapability.andCallFake(function (c) {
return c === 'context' && mockContext;
});
// Uses the mockLocation to get the current
// "mock" website's view
mockLocation.search.andReturn({ view: 'def' });
urlService = new UrlService(mockLocation);
});
it("get url for a location using domainObject and mode", function () {
urlService.urlForLocation(mockMode, mockDomainObject);
});
it("get url for a new tab using domainObject and mode", function () {
urlService.urlForNewTab(mockMode, mockDomainObject);
});
});
}
);
);

View File

@@ -63,7 +63,7 @@ define([
beforeEach(function () {
mockGestureService = jasmine.createSpyObj(
'gestureService',
[ 'attachGestures' ]
['attachGestures']
);
mockGestureHandle = jasmine.createSpyObj('gestures', ['destroy']);
@@ -100,15 +100,15 @@ define([
function makeGenericCapabilities() {
var mockContext =
jasmine.createSpyObj('context', [ 'getPath' ]),
jasmine.createSpyObj('context', ['getPath']),
mockType =
jasmine.createSpyObj('type', [ 'getGlyph' ]),
jasmine.createSpyObj('type', ['getGlyph']),
mockLocation =
jasmine.createSpyObj('location', [ 'isLink' ]),
jasmine.createSpyObj('location', ['isLink']),
mockMutation =
jasmine.createSpyObj('mutation', [ 'listen' ]),
jasmine.createSpyObj('mutation', ['listen']),
mockStatus =
jasmine.createSpyObj('status', [ 'listen', 'list' ]);
jasmine.createSpyObj('status', ['listen', 'list']);
mockStatus.list.andReturn([]);
@@ -231,7 +231,7 @@ define([
calledBackInner = false;
newCapabilities.composition =
jasmine.createSpyObj('composition', [ 'invoke' ]);
jasmine.createSpyObj('composition', ['invoke']);
newCapabilities.composition.invoke
.andReturn(Promise.resolve([mockGrandchild]));
mockComposition.push(mockNewChild);
@@ -274,7 +274,7 @@ define([
beforeEach(function () {
var mockStatus = mockComposition[1].getCapability('status');
testStatuses = [ 'foo' ];
testStatuses = ['foo'];
mockStatus.list.andReturn(testStatuses);
mockStatus.listen.mostRecentCall.args[0](testStatuses);