Skip to content

Commit c2e32fa

Browse files
author
Jeremy Nagel
committed
test($tests): Add tests for tickFormatMaxMin property of axis model
1 parent d525988 commit c2e32fa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/mocha/axis.coffee

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,18 @@ describe 'NVD3', ->
153153

154154
tick = builder.$ '.nv-y.nv-axis .tick.zero'
155155
tick.length.should.equal 1, 'y axis zero'
156+
157+
it 'default tick format for max/min should be integer based', ->
158+
axis = builder.model.xAxis
159+
builder.model.update()
160+
minAxisText = builder.$('.nv-axisMaxMin.nv-axisMaxMin-x.nv-axisMin-x text')[0].textContent
161+
162+
minAxisText.should.equal('-1')
163+
164+
it 'tickFormatMaxMin should change tick format of max/min', ->
165+
axis = builder.model.xAxis
166+
axis.tickFormatMaxMin(d3.format(',.2f'))
167+
builder.model.update()
168+
minAxisText = builder.$('.nv-axisMaxMin.nv-axisMaxMin-x.nv-axisMin-x text')[0].textContent
169+
170+
minAxisText.should.equal('-1.00')

0 commit comments

Comments
 (0)