Skip to content

Conversation

ddcat1115
Copy link
Contributor

Select[multipie || tags] with OptGroup can reproduce

relervant: ant-design/ant-design#5567

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 95.361% when pulling 7ef72f7 on ddcat1115:master into 712d960 on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 95.361% when pulling f80188c on ddcat1115:master into 712d960 on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 95.704% when pulling f7303f4 on ddcat1115:master into 712d960 on react-component:master.

</Select>
);
expect(renderToJson(wrapper)).toMatchSnapshot();
expect(errorSpy).not.toHaveBeenCalled();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个测试写 Select.multipe.spec.js 里就可以了吧,测试是否报错可以用 not.toThrow,没必要 mock console.errorsnapshot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

然后这个错误应该是在选择的时候会出现,所以这里要模拟一下选择。tags 模式下也会报错,可以照这样写 https://github.com/react-component/select/blob/master/tests/Select.multiple.spec.js#L12

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

错误是初始化时就报的,跟选择行为没啥关系。。。测试写法已更新~

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 95.748% when pulling bb814e5 on ddcat1115:master into f74811e on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 95.748% when pulling bb814e5 on ddcat1115:master into f74811e on react-component:master.

</OptGroup>
</Select>,
);
}).not.toThrow();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个用例本来就是 ok 的吧?

单独写个用例吧。

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 95.748% when pulling cd04546 on ddcat1115:master into f74811e on react-component:master.

@yesmeck yesmeck merged commit bbdfb62 into react-component:master Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants