-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from palantir/add-axis-tests
Added a rudimentary axis test.
- Loading branch information
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
///<reference path="testReference.ts" /> | ||
|
||
var assert = chai.assert; | ||
|
||
describe("Axes", () => { | ||
// TODO: Rewrite these tests when the Axis class gets refactored | ||
it("Renders ticks", () => { | ||
var svg = generateSVG(500, 100); | ||
var xScale = new LinearScale(); | ||
xScale.domain([0, 10]); | ||
xScale.range([0, 500]); | ||
var axis = new XAxis(xScale, "bottom"); | ||
axis.anchor(svg).computeLayout().render(); | ||
var ticks = svg.selectAll(".tick"); | ||
assert.operator(ticks[0].length, ">=", 2, "There are at least two ticks."); | ||
svg.remove(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters