Skip to content

Commit

Permalink
test: activeKey支持数字0边界值测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
知吱 committed May 26, 2021
1 parent 88cddfd commit 0514523
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,26 @@ describe('collapse', () => {

runNormalTest(element);
});
describe('it should support activeKey number 0', () => {
const collapse = mount(
<Collapse onChange={onChange} activeKey={0}>
<Panel header="collapse 0" key={0}>
zero
</Panel>
<Panel header="collapse 1" key={1}>
first
</Panel>
<Panel header="collapse 2" key={2}>
second
</Panel>
</Collapse>,
);;

it('activeKey number 0, should open one item', () => {
expect(collapse.find('.rc-collapse-content-active').length).toBe(1);
});

});

describe('destroyInactivePanel', () => {
const collapse = mount(
Expand Down

0 comments on commit 0514523

Please sign in to comment.