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

test: add unit test for folderTree in workbench #391

Merged
merged 6 commits into from
Sep 2, 2021
Merged

Conversation

mortalYoung
Copy link
Collaborator

@mortalYoung mortalYoung commented Sep 2, 2021

简介

  • folderTree 新增测试用例
  • 修复 folderTree 的 onContextMenu 方法参数不一致的问题
  • 提取 mock scrollable 组件的方法

主要变更

  • onContextMenu 参数不一致的原因是因为 folderTree 本身有一个 contextMenu ,treeNode 有一个 contextMenu,公用了 onContextMenu 这个方法,然后本身的 contextMenu 是没有第二个 treeNode 的参数的

@mortalYoung mortalYoung added bug Something isn't working unit test The PR is for the unit test mainly labels Sep 2, 2021
@mortalYoung mortalYoung added this to the 0.9.0-alpha.5 milestone Sep 2, 2021
@mortalYoung mortalYoung self-assigned this Sep 2, 2021
@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #391 (aecb20f) into main (f8eddab) will increase coverage by 1.54%.
The diff coverage is 56.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #391      +/-   ##
==========================================
+ Coverage   75.17%   76.72%   +1.54%     
==========================================
  Files         176      176              
  Lines        4806     4808       +2     
  Branches     1036     1039       +3     
==========================================
+ Hits         3613     3689      +76     
+ Misses       1185     1111      -74     
  Partials        8        8              
Impacted Files Coverage Δ
src/controller/explorer/explorer.tsx 43.39% <0.00%> (ø)
src/controller/explorer/folderTree.tsx 20.28% <0.00%> (-0.30%) ⬇️
...c/services/workbench/explorer/folderTreeService.ts 96.49% <ø> (ø)
src/workbench/sidebar/explore/folderTree.tsx 97.61% <100.00%> (+86.77%) ⬆️
src/components/tree/index.tsx 89.02% <0.00%> (+1.21%) ⬆️
src/common/dom.ts 77.96% <0.00%> (+3.38%) ⬆️

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 f8eddab...aecb20f. Read the comment docs.

@mortalYoung
Copy link
Collaborator Author

ci 不通过的原因是因为修改了 controller 而 controller 目前还么有测试用例的覆盖,所以报错了

Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

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

+1

@wewoor wewoor merged commit 3066baa into main Sep 2, 2021
@wewoor wewoor deleted the test/foldertree branch September 2, 2021 07:33
@mortalYoung mortalYoung mentioned this pull request Sep 2, 2021
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unit test The PR is for the unit test mainly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants