Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #498 from FormidableLabs/bug/chart-tick-format
Browse files Browse the repository at this point in the history
Bug/chart tick format
  • Loading branch information
boygirl authored Jul 17, 2017
2 parents 2828c21 + dade6db commit 330fa10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/victory-chart/helper-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default {
const dataTicks = ["", ...dataNames, ""];
return (x) => dataTicks[x];
} else {
return calculatedProps.scale[currentAxis].tickFormat() || identity;
return undefined;
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ describe("victory-chart/helpers-methods", () => {
describe("getTickFormat", () => {
const stringMap = { x: { "a": 1, "b": 2, "c": 3 } };
const nullStringMap = { x: null };
const scale = { x: { tickFormat: () => () => "scaleFormatTick" } };

it("returns the identity function when tickValues are numerical", () => {
const props = { tickValues: [1, 2, 3] };
Expand All @@ -179,12 +178,12 @@ describe("victory-chart/helpers-methods", () => {
expect(formatResult(1)).to.equal("a");
});

it("returns the tickFormat function from scale", () => {
it("returns undefined if no tickValues or stringMaps exist", () => {
const victoryAxis = getVictoryAxis({});
const formatResult = Helpers.getTickFormat(
victoryAxis, "x", { stringMap: nullStringMap, scale }
victoryAxis, "x", { stringMap: nullStringMap }
);
expect(formatResult(1)).to.equal("scaleFormatTick");
expect(formatResult).to.equal(undefined);
});
});

Expand Down

0 comments on commit 330fa10

Please sign in to comment.