-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
光弘
committed
Sep 14, 2018
1 parent
d80fb63
commit f63e782
Showing
4 changed files
with
57 additions
and
57 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import expect from 'expect.js'; | ||
import React from 'react'; | ||
import Enzyme, { mount } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-15'; | ||
import Carousel from '../src'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
describe('Carousel', () => { | ||
it('className prop works', () => { | ||
const node = mount(<Carousel className="test-classname" />); | ||
expect(node.props().className).to.equal('test-classname'); | ||
}); | ||
|
||
it('prefixCls prop works', () => { | ||
const node = mount(<Carousel prefixCls="test-prefix" />); | ||
expect(node.find('.test-prefix')).to.have.length(1); | ||
}); | ||
|
||
it('centerDots prop works', () => { | ||
const node1 = mount(<Carousel prefixCls="test-prefix" />); | ||
expect(node1.find('.test-prefix-dots-centered')).to.have.length(1); | ||
|
||
const node2 = mount(<Carousel prefixCls="test-prefix" centerDots={false} />); | ||
expect(node2.find('.test-prefix-dots-centered')).to.have.length(0); | ||
}); | ||
|
||
it('largeArrowsAndDots prop works', () => { | ||
const node1 = mount(<Carousel prefixCls="test-prefix" />); | ||
expect(node1.find('.test-prefix-large-mode')).to.have.length(0); | ||
|
||
const node2 = mount(<Carousel prefixCls="test-prefix" largeArrowsAndDots />); | ||
expect(node2.find('.test-prefix-large-mode')).to.have.length(1); | ||
}); | ||
|
||
it('arrows === always works', () => { | ||
const node1 = mount(<Carousel prefixCls="test-prefix" arrows="test" />); | ||
expect(node1.find('.test-prefix-always-show-arrows')).to.have.length(0); | ||
|
||
const node2 = mount(<Carousel prefixCls="test-prefix" arrows="always" />); | ||
expect(node1.find('.test-prefix-always-show-arrows')).to.have.length(0); | ||
}); | ||
|
||
it('coverage improve', () => { | ||
mount( | ||
<Carousel> | ||
<div> | ||
a | ||
</div> | ||
</Carousel>, | ||
); | ||
}); | ||
}); |
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