-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* input test (#8) * Update README.md * TagGroup 动态添加数据 点击删除无法获取相应数据问题 * Update README.md * input test * 合并 * input test2 (#9) * Update README.md * TagGroup 动态添加数据 点击删除无法获取相应数据问题 * Update README.md * input test * 合并 * input test2 * Adding default value of porps size on module Avatar and some test cases. * fix(affix): Fix bug where body.scrollTop is 0. * InputNumber add defaultValue (#11) InputNumber add defaultValue, add test case. * Remove extraneous props `status` from doc and add test cases. * Add test cases of Breadcrumb * Add test cases of Affix * Remove console log
- Loading branch information
1 parent
c459fe7
commit 18e123b
Showing
3 changed files
with
60 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import Affix from '../'; | ||
|
||
|
||
describe('<Affix>', () => { | ||
const Component = mount(<Affix />) | ||
|
||
it('The name of module must be "Affix"', () => { | ||
expect(Component.name()).toBe('Affix') | ||
}); | ||
|
||
it('The default performance should be fixed at top 0', () => { | ||
Component.setState({ position: 'fixed', top: 0 }) | ||
expect(Component.state().position).toBe('fixed') | ||
expect(Component.state().top).toEqual(0) | ||
Component.setState({ position: null, top: null }) | ||
}); | ||
}); |
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,34 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import Breadcrumb from '../'; | ||
|
||
|
||
describe('<Breadcrumb>', () => { | ||
const Component = mount(<Breadcrumb> | ||
<Breadcrumb.Item href="https://uiw-react.github.io">首页</Breadcrumb.Item> | ||
<Breadcrumb.Item separator="#">活动管理</Breadcrumb.Item> | ||
<Breadcrumb.Item>活动列表</Breadcrumb.Item> | ||
<Breadcrumb.Item>活动详情</Breadcrumb.Item> | ||
</Breadcrumb>) | ||
|
||
it('The name of module must be "Breadcrumb"', () => { | ||
expect(Component.name()).toBe('Breadcrumb') | ||
}); | ||
|
||
it('The length of breadcrumb item should be 4', () => { | ||
expect(Component.find('.w-breadcrumb-item')).toHaveLength(4) | ||
}); | ||
|
||
it('The separator should be charactor "@"', () => { | ||
Component.setProps({ separator: '@' }) | ||
expect(Component.find('.w-breadcrumb-item-separator').at(0).text()).toBe('@') | ||
}); | ||
|
||
it('The item separator should be charactor "#"', () => { | ||
expect(Component.find('.w-breadcrumb-item-separator').at(1).text()).toBe('#') | ||
}); | ||
|
||
it('The href of item first should be "https://uiw-react.github.io"', () => { | ||
expect(Component.find('.w-breadcrumb-item a').prop('href')).toEqual('https://uiw-react.github.io') | ||
}); | ||
}); |
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