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

Todo Works #5

Open
11 of 14 tasks
JackWang032 opened this issue Jun 27, 2023 · 1 comment
Open
11 of 14 tasks

Todo Works #5

JackWang032 opened this issue Jun 27, 2023 · 1 comment

Comments

@JackWang032
Copy link
Contributor

JackWang032 commented Jun 27, 2023

待添加组件

  • Menu
  • Breadcrumb
  • Card
  • Rate
  • Typography
  • Segmented
  • Tag
  • Alert
  • Message
  • Notification
  • Anchor
  • BackTop
  • Pagination

待补全功能

  • query查询功能补全
  • 使用文档与JsDoc
  • 事件触发结果为异步的通过async标识如fireUploadAsync
  • Script for appending example into comment automatically

待解决问题

  • 拥有popup特性的组件,默认会将popup渲染在body下,使用container会查询不到,需要手动指定getPopupContainer,或传入baseElement而非container
  • 多个Select 下拉框, 展示popup时会动态插入到body中,fireSelect时无法确认是具体哪个Select的下拉列表,需要移除之前的下拉列表来保证查询到唯一性
@mortalYoung
Copy link
Owner

mortalYoung commented Jun 29, 2023

我觉得待解决的这两个问题是同一个问题,这个单测,我觉得能解决这个问题,参考一下

test('fireChange with multiple', () => {
const fn1 = jest.fn();
const fn2 = jest.fn();
const { container } = render(
<>
<Cascader onChange={fn1} getPopupContainer={(node) => node.parentNode} options={options} />
<Cascader onChange={fn2} getPopupContainer={(node) => node.parentNode} options={options} />
</>
);
fireOpen(container);
fireChange(container, 0, 0, 0);
expect(fn1).toBeCalledTimes(1);
expect(fn2).toBeCalledTimes(0);
fireOpen(query(container, 1)!);
fireChange(queryDropdown(container, 1)!, 0, 0, 0);
expect(fn1).toBeCalledTimes(1);
expect(fn2).toBeCalledTimes(1);

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

No branches or pull requests

2 participants