Skip to content

Commit

Permalink
FLOE-404: clean up linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
waharnum committed Aug 31, 2015
1 parent d6d9a8a commit 42a9970
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/js/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ https://github.com/gpii/universal/LICENSE.txt
addedRows
.append("td")
.attr({
"style": function (d, i) {
"style": function (d) {
return "background-color: "+d.color+";";
},
"class": legendColorCellClass
Expand All @@ -116,15 +116,15 @@ https://github.com/gpii/universal/LICENSE.txt
.attr({
"class": legendLabelCellClass
})
.html(function (d, i) {
.html(function (d) {
return d.label;
});

addedRows.append("td")
.attr({
"class": legendValueCellClass
})
.html(function (d,i) {
.html(function (d) {
return d.value;
});

Expand All @@ -139,7 +139,7 @@ https://github.com/gpii/universal/LICENSE.txt
}
};

gpii.chartAuthoring.pieChart.legend.create = function(that) {
gpii.chartAuthoring.pieChart.legend.create = function (that) {
var container = that.container,
dataSet = that.model.dataSet,
l = that.options.legendOptions,
Expand Down
11 changes: 5 additions & 6 deletions tests/js/legendTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ https://github.com/gpii/universal/LICENSE.txt
var g = (hex & 0x00ff00) >> 8;
var b = hex & 0x0000ff;
return "rgb("+r+", "+g + ", " +b + ")";
}
};

gpii.tests.chartAuthoring.testMouseOverListener = function (that) {
jqUnit.assertFalse("The mouseover listener for legend rows has not been triggered", that.mouseOverListenerCalled);
var oneD3Row = that.jQueryToD3($(that.locate("row")[0]));
oneD3Row.on("mouseover")();
jqUnit.assertTrue("The mouseover listener for legend rows has been triggered", that.mouseOverListenerCalled);
}
};

gpii.tests.chartAuthoring.validateLegend = function (that) {
var table = that.locate("table");
Expand All @@ -118,18 +118,17 @@ https://github.com/gpii/universal/LICENSE.txt
jqUnit.assertEquals("A TR element has been created for each value in the dataset, with proper selectors", that.model.dataSet.length, that.locate("row").length);

var d3ColorCells = that.jQueryToD3($(that.locate("legendColorCell")));
d3ColorCells.each(function (d, i) {
d3ColorCells.each(function (d) {

jqUnit.assertEquals("The data colors are filled correctly in the legend", gpii.tests.chartAuthoring.hexToRGB(d.color), ($(this).css("background-color")));
});

var d3LabelCells = that.jQueryToD3($(that.locate("labelCell")));
d3LabelCells.each(function (d, i) {
d3LabelCells.each(function (d) {
jqUnit.assertEquals("The data labels are applied correctly in the legend", d.label, ($(this).html()));
});

var d3LabelCells = that.jQueryToD3($(that.locate("valueCell")));
d3LabelCells.each(function (d, i) {
d3LabelCells.each(function (d) {
jqUnit.assertEquals("The data values are applied correctly in the legend", d.value, ($(this).html()));
});

Expand Down

0 comments on commit 42a9970

Please sign in to comment.