test: update test case.

This commit is contained in:
SimaQ
2015-10-15 11:01:15 +08:00
parent 2588a2b919
commit d6779510f9
3 changed files with 15 additions and 2 deletions
+6
View File
@@ -142,6 +142,12 @@ React.render(<Rcslider />, container);
<td>''</td>
<td>Set the animation for tooltip if it shows.</td>
</tr>
<tr>
<td>withDots</td>
<td>bool</td>
<td>false</td>
<td>For linear slider, when the `step` value is greater than 1, you can set the `withDots` to `true` if you want to render the slider bar with dots.</td>
</tr>
</tbody>
</table>
+1
View File
@@ -10,5 +10,6 @@ function onChange(v){
}
// React.render(<div style={{width:400,margin:100}}><Slider marks={["一","二","三","四","五"]} defaultIndex={2} /></div>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider withDots className='rc-slider' step={20}/></div>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider className='rc-slider' step={20}/></div>, document.getElementById('__react-content'));
React.render(<div style={{width:400,margin:100}}><Slider onChange={onChange} tipTransitionName='rc-slider-tooltip-zoom-down'/></div>, document.getElementById('__react-content'));
+8 -2
View File
@@ -39,8 +39,14 @@ describe('rc-slider', function () {
expect(node.find('.rc-slider').length).to.be(1);
expect(node.find('.rc-slider-handle').length).to.be(1);
expect(node.find('.rc-slider-track').length).to.be(1);
expect(node.find('.rc-slider-dot').length).to.be(6);
expect(slider.state.value).to.be(0);
var sliderWithDots = React.render(
<Slider className='rc-slider' step={20} withDots/>,
div
);
var node1 = $(div);
expect(node1.find('.rc-slider-dot').length).to.be(6);
});
it('should render a slider with marks correctly!', function () {
@@ -64,7 +70,7 @@ describe('rc-slider', function () {
// div
// );
// var selectedStep = slider.refs.step3.getDOMNode();
// Simulate.mouseDown(selectedStep);
// setTimeout( function() {