Permalink
Browse files

Adding focusEnable unit tests

1 parent 51f2381 commit 4fce5c7f1c08f6c2f28aad7e519eaefbb1e74b08 @MikeMatusz MikeMatusz committed on GitHub Nov 2, 2016
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/mocha/line.coffee
@@ -130,3 +130,21 @@ describe 'NVD3', ->
scatter = builder.$ '.nv-scatterWrap .nv-groups .nv-group.dashed'
scatter.length.should.equal 1, 'one classed element is from scatter'
+ it 'shows focus chart when focusEnable is set to true', ->
+ builder.model.focusEnable(true).update();
+ focus = builder.$ '.nv-focusWrap .nv-focus'
+ should.exist focus[0]
+
+ it 'hides focus chart when focusEnable is set to false', ->
+ builder.model.focusEnable(true).update();
+ builder.model.focusEnable(false).update();
+ focusWrap = builder.$ '.nv-focusWrap'
+ focusWrap[0].style.display.should.equal 'none'
+
+ it 'does not reset selected focus range when focusEnable is set to false', ->
+ builder.model.focusEnable(true).update();
+ builder.model.brushExtent([0, 1]).update();
+ builder.model.focusEnable(false).update();
+ builder.model.brushExtent()[0].should.equal 0
+ builder.model.brushExtent()[1].should.equal 1
+

0 comments on commit 4fce5c7

Please sign in to comment.