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

refactor(timeline): rewrite with hook #23631

Merged
merged 6 commits into from
May 2, 2020
Merged

refactor(timeline): rewrite with hook #23631

merged 6 commits into from
May 2, 2020

Conversation

hengkx
Copy link
Member

@hengkx hengkx commented Apr 26, 2020

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English refactor with hook
🇨🇳 Chinese 用 react hook 重构

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Apr 26, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 26, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4b9648d:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Apr 26, 2020

Codecov Report

Merging #23631 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23631      +/-   ##
==========================================
+ Coverage   98.50%   98.51%   +0.01%     
==========================================
  Files         363      363              
  Lines        7209     7205       -4     
  Branches     2000     2000              
==========================================
- Hits         7101     7098       -3     
+ Misses        108      107       -1     
Impacted Files Coverage Δ
components/timeline/Timeline.tsx 100.00% <100.00%> (ø)
components/timeline/TimelineItem.tsx 100.00% <100.00%> (+8.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dabec4c...4b9648d. Read the comment docs.

@hengkx
Copy link
Member Author

hengkx commented Apr 27, 2020

https://codecov.io/gh/ant-design/ant-design/pull/23631/diff?src=pr&el=tree#D1-22

这一行我加了color 为什么还覆盖不到...

@hengkx
Copy link
Member Author

hengkx commented Apr 27, 2020

color 有defaultProps

@hengkx
Copy link
Member Author

hengkx commented Apr 28, 2020

@afc163 请教个问题

it('should keepAlign by calling forcePopupAlign', async () => {
const wrapper = mount(<Slider defaultValue={30} tooltipVisible />);
wrapper.find('Tooltip').instance().tooltip.forcePopupAlign = jest.fn();
await sleep(20);
expect(wrapper.find('Tooltip').instance().tooltip.forcePopupAlign).toHaveBeenCalled();
});

Tooltip 改为func的话,没有instance方法了,设置属性好像也不能给子组件设置,有什么好的方法吗?单独测试SliderTooltip?

@afc163
Copy link
Member

afc163 commented Apr 28, 2020

用具体交互来测试吧,交互不行可以删用例。

@hengkx hengkx merged commit 3d355fd into master May 2, 2020
@hengkx hengkx deleted the refactor/timeline branch May 2, 2020 10:55
@ycjcl868 ycjcl868 mentioned this pull request May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants