[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

@@ -33,7 +33,7 @@ define(
chart;
beforeEach(function () {
mockCanvas = jasmine.createSpyObj("canvas", [ "getContext" ]);
mockCanvas = jasmine.createSpyObj("canvas", ["getContext"]);
mock2d = jasmine.createSpyObj(
"2d",
[
@@ -72,8 +72,8 @@ define(
});
it("allows lines to be drawn", function () {
var testBuffer = [ 0, 1, 3, 8 ],
testColor = [ 0.25, 0.33, 0.66, 1.0 ],
var testBuffer = [0, 1, 3, 8],
testColor = [0.25, 0.33, 0.66, 1.0],
testPoints = 2;
chart.drawLine(testBuffer, testColor, testPoints);
expect(mock2d.beginPath).toHaveBeenCalled();
@@ -84,7 +84,7 @@ define(
it("allows squares to be drawn", function () {
var testMin = [0, 1],
testMax = [10, 10],
testColor = [ 0.25, 0.33, 0.66, 1.0 ];
testColor = [0.25, 0.33, 0.66, 1.0];
chart.drawSquare(testMin, testMax, testColor);
expect(mock2d.fillRect).toHaveBeenCalled();
@@ -92,4 +92,4 @@ define(
});
}
);
);

View File

@@ -33,7 +33,7 @@ define(
glChart;
beforeEach(function () {
mockCanvas = jasmine.createSpyObj("canvas", [ "getContext" ]);
mockCanvas = jasmine.createSpyObj("canvas", ["getContext"]);
mockGL = jasmine.createSpyObj(
"gl",
[
@@ -98,8 +98,8 @@ define(
});
it("allows lines to be drawn", function () {
var testBuffer = [ 0, 1, 3, 8 ],
testColor = [ 0.25, 0.33, 0.66, 1.0 ],
var testBuffer = [0, 1, 3, 8],
testColor = [0.25, 0.33, 0.66, 1.0],
testPoints = 2;
glChart.drawLine(testBuffer, testColor, testPoints);
expect(mockGL.bufferData).toHaveBeenCalledWith(
@@ -116,7 +116,7 @@ define(
it("allows squares to be drawn", function () {
var testMin = [0, 1],
testMax = [10, 10],
testColor = [ 0.25, 0.33, 0.66, 1.0 ];
testColor = [0.25, 0.33, 0.66, 1.0];
glChart.drawSquare(testMin, testMax, testColor);
@@ -140,4 +140,4 @@ define(
});
});
}
);
);

View File

@@ -55,7 +55,7 @@ define(
// mct-chart uses GLChart, so it needs WebGL API
mockCanvas =
jasmine.createSpyObj("canvas", [ "getContext", "addEventListener" ]);
jasmine.createSpyObj("canvas", ["getContext", "addEventListener"]);
mockGL = jasmine.createSpyObj(
"gl",
[
@@ -122,7 +122,7 @@ define(
it("issues one draw call per line", function () {
mctChart.link(mockScope, mockElement);
mockScope.$watchCollection.mostRecentCall.args[1]({
lines: [ {}, {}, {} ]
lines: [{}, {}, {}]
});
expect(mockGL.drawArrays.calls.length).toEqual(3);
});

View File

@@ -63,15 +63,15 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
"$scope",
[ "$watch", "$on", "$emit" ]
["$watch", "$on", "$emit"]
);
mockFormatter = jasmine.createSpyObj(
"formatter",
[ "formatDomainValue", "formatRangeValue" ]
["formatDomainValue", "formatRangeValue"]
);
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
["getId", "getModel", "getCapability"]
);
mockHandler = jasmine.createSpyObj(
"telemetrySubscriber",
@@ -96,7 +96,9 @@ define(
);
mockHandler.handle.andReturn(mockHandle);
mockThrottle.andCallFake(function (fn) { return fn; });
mockThrottle.andCallFake(function (fn) {
return fn;
});
mockHandle.getTelemetryObjects.andReturn([mockDomainObject]);
mockHandle.getMetadata.andReturn([{}]);
mockHandle.getDomainValue.andReturn(123);

View File

@@ -58,7 +58,7 @@ define(
mockComposition = [
mockChildOne
];
mockCompositionCapability.then.andCallFake(function (callback){
mockCompositionCapability.then.andCallFake(function (callback) {
callback(mockComposition);
});
@@ -79,7 +79,7 @@ define(
'useCapability',
'getCapability'
]);
mockDomainObject.useCapability.andCallFake(function(capability){
mockDomainObject.useCapability.andCallFake(function (capability) {
return mockUseCapabilities[capability]();
});
mockDomainObject.getCapability.andReturn(mockMutationCapability);

View File

@@ -36,20 +36,20 @@ define(
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
["getId", "getModel", "getCapability"]
);
mockPanZoomStack = jasmine.createSpyObj(
"panZoomStack",
[ "getPanZoom" ]
["getPanZoom"]
);
mockFormatter = jasmine.createSpyObj(
"formatter",
[ "formatDomainValue", "formatRangeValue" ]
["formatDomainValue", "formatRangeValue"]
);
mockPanZoomStack.getPanZoom.andReturn({
origin: [ 0, 0 ],
dimensions: [ 100, 100 ]
origin: [0, 0],
dimensions: [100, 100]
});
factory = new SubPlotFactory(mockFormatter);
@@ -63,4 +63,4 @@ define(
});
});
}
);
);

View File

@@ -40,7 +40,7 @@ define(
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
["getId", "getModel", "getCapability"]
);
mockPanZoomStack = jasmine.createSpyObj(
"panZoomStack",
@@ -57,16 +57,16 @@ define(
);
mockFormatter = jasmine.createSpyObj(
"formatter",
[ "formatDomainValue", "formatRangeValue" ]
["formatDomainValue", "formatRangeValue"]
);
mockElement = jasmine.createSpyObj(
"element",
[ "getBoundingClientRect" ]
["getBoundingClientRect"]
);
testOrigin = [ 5, 10 ];
testDimensions = [ 3000, 1000 ];
testDomainObjects = [ mockDomainObject, mockDomainObject ];
testOrigin = [5, 10];
testDimensions = [3000, 1000];
testDomainObjects = [mockDomainObject, mockDomainObject];
mockPanZoomStack.getOrigin.andReturn(testOrigin);
mockPanZoomStack.getDimensions.andReturn(testDimensions);
@@ -163,7 +163,7 @@ define(
mockPanZoomStack.getDimensions.andReturn([0,0]);
expect(subplot.hasDomainData()).toEqual(false);
});
it("disallows marquee zoom when start and end Marquee is at the same position", function () {
expect(mockPanZoomStack.pushPanZoom).not.toHaveBeenCalled();

View File

@@ -88,7 +88,7 @@ define(
});
it("reflects changes to applicable metadata", function () {
axis.updateMetadata([ testMetadatas[1] ]);
axis.updateMetadata([testMetadatas[1]]);
expect(axis.options).toEqual([
{ key: "t0", name: "T0" },
{ key: "t2", name: "T2" }

View File

@@ -41,11 +41,11 @@ define(
mockTelemetryObjects = ['a', 'b', 'c'].map(function (id, i) {
var mockTelemetryObject = jasmine.createSpyObj(
'object-' + id,
[ 'getId', 'getCapability', 'getModel' ]
['getId', 'getCapability', 'getModel']
),
mockLimitCapability = jasmine.createSpyObj(
'limit-' + id,
[ 'evaluate' ]
['evaluate']
);
testData[id] = { id: id, value: i };
mockTelemetryObject.getId.andReturn(id);

View File

@@ -38,8 +38,8 @@ define(
buffer;
beforeEach(function () {
testDomainValues = [ 1, 3, 7, 9, 14, 15 ];
testRangeValues = [ 8, 0, 3, 9, 8, 11 ];
testDomainValues = [1, 3, 7, 9, 14, 15];
testRangeValues = [8, 0, 3, 9, 8, 11];
mockSeries = jasmine.createSpyObj(
"series",
['getPointCount', 'getDomainValue', 'getRangeValue']
@@ -70,7 +70,7 @@ define(
// that domain offset was adjusted for.
expect(
Array.prototype.slice.call(buffer.getBuffer()).slice(0, 12)
).toEqual([ -41, 8, -39, 0, -35, 3, -33, 9, -28, 8, -27, 11]);
).toEqual([-41, 8, -39, 0, -35, 3, -33, 9, -28, 8, -27, 11]);
expect(buffer.getLength()).toEqual(6);
});
@@ -84,8 +84,8 @@ define(
});
it("allows insertion in the middle", function () {
var head = [ -41, 8, -39, 0, -35, 3 ],
tail = [ -33, 9, -28, 8, -27, 11];
var head = [-41, 8, -39, 0, -35, 3],
tail = [-33, 9, -28, 8, -27, 11];
buffer.insert(mockSeries, 3);
expect(
Array.prototype.slice.call(buffer.getBuffer()).slice(0, 24)
@@ -98,7 +98,7 @@ define(
expect(buffer.getLength()).toEqual(4);
expect(
Array.prototype.slice.call(buffer.getBuffer()).slice(0, 8)
).toEqual([ -35, 3, -33, 9, -28, 8, -27, 11]);
).toEqual([-35, 3, -33, 9, -28, 8, -27, 11]);
});
it("expands buffer when needed to accommodate more data", function () {

View File

@@ -101,7 +101,7 @@ define(
});
it("allows series insertion", function () {
testSeries = [ [ 50, 42 ], [ 100, 200 ], [ 150, 12321 ] ];
testSeries = [[50, 42], [100, 200], [150, 12321]];
line.addSeries(mockSeries);
// Should have managed insertion index choices to get to...
expect(testDomainBuffer).toEqual([50, 100, 150]);
@@ -109,7 +109,7 @@ define(
});
it("splits series insertion when necessary", function () {
testSeries = [ [ 50, 42 ], [ 100, 200 ], [ 150, 12321 ] ];
testSeries = [[50, 42], [100, 200], [150, 12321]];
line.addPoint(75, 1);
line.addSeries(mockSeries);
// Should have managed insertion index choices to get to...
@@ -130,4 +130,4 @@ define(
});
}
);
);

View File

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

View File

@@ -49,7 +49,7 @@ define(
it("synchronizes pan-zoom stack depth", function () {
expect(group.getDepth()).toEqual(1);
group.getPanZoomStack(1).pushPanZoom([ 10, 20 ], [ 30, 40 ]);
group.getPanZoomStack(1).pushPanZoom([10, 20], [30, 40]);
stacks.forEach(function (stack) {
expect(stack.getDepth()).toEqual(2);
});
@@ -58,11 +58,11 @@ define(
it("synchronizes domain but not range", function () {
// Set up different initial states
stacks.forEach(function (stack, i) {
stack.pushPanZoom([ i, i ], [ i, i ]);
stack.pushPanZoom([i, i], [i, i]);
});
// Push a new pan-zoom state onto one of the stacks
group.getPanZoomStack(1).pushPanZoom([ 99, 99 ], [ 42, 42 ]);
group.getPanZoomStack(1).pushPanZoom([99, 99], [42, 42]);
// Should changed domain values for all stacks, but
// only changed range values for stack 1
@@ -85,7 +85,7 @@ define(
it("clears pan-zoom on request", function () {
// Set up different initial states
stacks.forEach(function (stack, i) {
stack.pushPanZoom([ i, i ], [ i, i ]);
stack.pushPanZoom([i, i], [i, i]);
});
// Verify that we have a greater depth
@@ -104,7 +104,7 @@ define(
it("pops pan-zoom on request", function () {
// Set up different initial states
stacks.forEach(function (stack, i) {
stack.pushPanZoom([ i, i ], [ i, i ]);
stack.pushPanZoom([i, i], [i, i]);
});
// Verify that we have a greater depth
@@ -123,4 +123,4 @@ define(
});
}
);
);

View File

@@ -46,10 +46,10 @@ define(
}
beforeEach(function () {
initialOrigin = [ 4, 2 ];
initialDimensions = [ 600, 400 ];
otherOrigins = [ [8, 6], [12, 9] ];
otherDimensions = [ [400, 300], [200, 300] ];
initialOrigin = [4, 2];
initialDimensions = [600, 400];
otherOrigins = [[8, 6], [12, 9]];
otherDimensions = [[400, 300], [200, 300]];
panZoomStack =
new PlotPanZoomStack(initialOrigin, initialDimensions);
});
@@ -96,4 +96,4 @@ define(
});
});
}
);
);

View File

@@ -29,13 +29,13 @@ define(
describe("A plot position", function () {
var mockPanZoom,
testOrigin = [ 10, 20 ],
testDimensions = [ 800, 10 ];
testOrigin = [10, 20],
testDimensions = [800, 10];
beforeEach(function () {
mockPanZoom = jasmine.createSpyObj(
"panZoomStack",
[ "getPanZoom" ]
["getPanZoom"]
);
mockPanZoom.getPanZoom.andReturn({
origin: testOrigin,
@@ -64,4 +64,4 @@ define(
});
});
}
);
);

View File

@@ -34,7 +34,7 @@ define(
function makeMockData(scale) {
var mockData = jasmine.createSpyObj(
"data" + scale,
[ "getPointCount", "getDomainValue", "getRangeValue" ]
["getPointCount", "getDomainValue", "getRangeValue"]
);
mockData.getPointCount.andReturn(1000);
mockData.getDomainValue.andCallFake(function (i) {
@@ -90,4 +90,4 @@ define(
});
}
);
);

View File

@@ -31,11 +31,11 @@ define(
beforeEach(function () {
testSeries = [
[ 0, 42 ],
[ 10, 1 ],
[ 20, 4 ],
[ 30, 9 ],
[ 40, 3 ]
[0, 42],
[10, 1],
[20, 4],
[30, 9],
[40, 3]
];
mockSeries = jasmine.createSpyObj(
@@ -90,4 +90,4 @@ define(
});
}
);
);

View File

@@ -35,16 +35,16 @@ define(
beforeEach(function () {
mockPanZoomStack = jasmine.createSpyObj(
"panZoomStack",
[ "getPanZoom" ]
["getPanZoom"]
);
mockFormatter = jasmine.createSpyObj(
"formatter",
[ "formatDomainValue", "formatRangeValue" ]
["formatDomainValue", "formatRangeValue"]
);
mockPanZoomStack.getPanZoom.andReturn({
origin: [ 0, 0 ],
dimensions: [ 100, 100 ]
origin: [0, 0],
dimensions: [100, 100]
});
generator =
@@ -70,4 +70,4 @@ define(
});
}
);
);

View File

@@ -39,19 +39,19 @@ define(
function makeMockDomainObject(id) {
var mockDomainObject = jasmine.createSpyObj(
"object-" + id,
[ "getId", "getCapability", "getModel" ]
["getId", "getCapability", "getModel"]
);
mockDomainObject.getId.andReturn(id);
return mockDomainObject;
}
beforeEach(function () {
var ids = [ 'a', 'b', 'c' ],
var ids = ['a', 'b', 'c'],
mockObjects = ids.map(makeMockDomainObject);
mockSubscription = jasmine.createSpyObj(
"subscription",
[ "getDomainValue", "getRangeValue", "getTelemetryObjects" ]
["getDomainValue", "getRangeValue", "getTelemetryObjects"]
);
mockSeries = jasmine.createSpyObj(
'series',

View File

@@ -34,11 +34,11 @@ define(
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
["getId", "getModel", "getCapability"]
);
mockSubPlotFactory = jasmine.createSpyObj(
"subPlotFactory",
[ "createSubPlot" ]
["createSubPlot"]
);
});
@@ -84,4 +84,4 @@ define(
});
});
}
);
);

View File

@@ -58,11 +58,11 @@ define(
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
["getId", "getModel", "getCapability"]
);
mockSubPlotFactory = jasmine.createSpyObj(
"subPlotFactory",
[ "createSubPlot" ]
["createSubPlot"]
);
// Prepared telemetry data
mockPrepared = jasmine.createSpyObj(
@@ -181,4 +181,4 @@ define(
});
});
}
);
);

View File

@@ -58,16 +58,16 @@ define(
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
["getId", "getModel", "getCapability"]
);
mockSubPlotFactory = jasmine.createSpyObj(
"subPlotFactory",
[ "createSubPlot" ]
["createSubPlot"]
);
// Prepared telemetry data
mockPrepared = jasmine.createSpyObj(
"prepared",
[ "getDomainOffset", "getOrigin", "getDimensions", "getLineBuffers" ]
["getDomainOffset", "getOrigin", "getDimensions", "getLineBuffers"]
);
mockSubPlotFactory.createSubPlot.andCallFake(createMockSubPlot);
@@ -176,4 +176,4 @@ define(
});
}
);
);

View File

@@ -51,23 +51,23 @@ define(
});
it("allows the imagery view for domain objects with numeric telemetry", function () {
testMetadata.ranges = [ { key: "foo", format: "number" } ];
testMetadata.ranges = [{ key: "foo", format: "number" }];
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
});
it("allows the imagery view for domain objects with unspecified telemetry", function () {
testMetadata.ranges = [ { key: "foo" } ];
testMetadata.ranges = [{ key: "foo" }];
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
});
it("disallows the imagery view for domain objects without image telemetry", function () {
testMetadata.ranges = [ { key: "foo", format: "somethingElse" } ];
testMetadata.ranges = [{ key: "foo", format: "somethingElse" }];
expect(policy.allow(testView, mockDomainObject)).toBeFalsy();
});
it("allows other views", function () {
testView.key = "somethingElse";
testMetadata.ranges = [ { key: "foo", format: "somethingElse" } ];
testMetadata.ranges = [{ key: "foo", format: "somethingElse" }];
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
});