Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Customize input element of combobox #145

Merged
merged 3 commits into from
Jan 3, 2017

Conversation

RaoHai
Copy link
Contributor

@RaoHai RaoHai commented Dec 6, 2016

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 95.606% when pulling 4a7d5be on RaoHai:getInputElement into 6b3544f on react-component:master.

</Select>
);

expect(wrapper.find('textarea').node).not.toBe(undefined);
Copy link
Member

Choose a reason for hiding this comment

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

可以 expect(wrapper.find('textarea').length).toBe(1);

@@ -72,4 +72,20 @@ describe('Select.combobox', () => {
dropdownWrapper.find('MenuItem').first().simulate('click');
expect(wrapper.state().inputValue).toBe('1');
});

it('should comstomize input element', () => {
Copy link
Member

Choose a reason for hiding this comment

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

这个好像不是 combobox 特有的 api?应该写到 Select.spec.js 里。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的,为 tags 和 multiple 也补充了用例。

Copy link
Member

Choose a reason for hiding this comment

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

这是公共的 feature 的话其实只要在 Select.spec.js 里写一次就可以了。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

放到 Select.spec.js 里会不会被认为是 Select 的基础功能?

Copy link
Member

Choose a reason for hiding this comment

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

我是从代码上看这个 getInputElement 是不分模式的,如果是只能在特定模式下用的话就写到特定模式的测试下。另外其他两个用例不应该直接 copy 已有的用例。

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 95.606% when pulling 8eff3ed on RaoHai:getInputElement into 6b3544f on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 95.606% when pulling 5f4aad6 on RaoHai:getInputElement into 6b3544f on react-component:master.

 + 为了支持 ant-design/ant-design#4082 (comment) 的用法
 + supplement specs of multiple and tags
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 95.606% when pulling 159f725 on RaoHai:getInputElement into 6b3544f on react-component:master.

@yiminghe
Copy link
Member

yiminghe commented Dec 8, 2016

改完了么,修改过程中加个 WIP

@RaoHai
Copy link
Contributor Author

RaoHai commented Dec 13, 2016

改完了

@yesmeck
Copy link
Member

yesmeck commented Dec 13, 2016

= = 测试要调整下吧。

@yiminghe
Copy link
Member

@yesmeck review 完需要合并时通知我

@RaoHai
Copy link
Contributor Author

RaoHai commented Dec 30, 2016

@yesmeck 这个可以合了么?combox, multiple, tags 的测试分别放在各自模式的测试文件里不合理么?

@yesmeck
Copy link
Member

yesmeck commented Dec 30, 2016

不应该去 copy 别的测试用例。

@yesmeck
Copy link
Member

yesmeck commented Dec 30, 2016

要测 custom input element 的话,测试用例里应该只包含 custom input element 的内容。

@yesmeck
Copy link
Member

yesmeck commented Dec 30, 2016

然后从代码上看这个功能是不分模式的,所以其实没必要每个模式都测一遍。

@RaoHai
Copy link
Contributor Author

RaoHai commented Dec 30, 2016

有道理。。

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 95.599% when pulling 15451d6 on RaoHai:getInputElement into 6b3544f on react-component:master.

@yesmeck
Copy link
Member

yesmeck commented Dec 30, 2016

propTypes 是不是也写一下。

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 95.599% when pulling 2412cb2 on RaoHai:getInputElement into 6b3544f on react-component:master.

@yesmeck
Copy link
Member

yesmeck commented Jan 3, 2017

@yiminghe 可以合并了。

@yiminghe yiminghe merged commit e8d6292 into react-component:master Jan 3, 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.

4 participants