Closed yangxiuxiu1115 closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
select | ❌ Failed (Inspect) | Jun 10, 2023 9:52am |
能添加test case 覆盖到这个问题吗?
Merging #943 (31b63bf) into master (7940e17) will decrease coverage by
0.01%
. The diff coverage is100.00%
.:exclamation: Current head 31b63bf differs from pull request most recent head d1526b9. Consider uploading reports for the commit d1526b9 to get more accurate results
@@ Coverage Diff @@
## master #943 +/- ##
==========================================
- Coverage 99.63% 99.63% -0.01%
==========================================
Files 37 37
Lines 1356 1352 -4
Branches 393 365 -28
==========================================
- Hits 1351 1347 -4
Misses 4 4
Partials 1 1
Impacted Files | Coverage Δ | |
---|---|---|
src/hooks/useSelectTriggerControl.ts | 94.44% <100.00%> (ø) |
... and 1 file with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
能添加test case 覆盖到这个问题吗?
我很乐意会它添加对应的 test case,我尝试了许多次,可能是因为我对 jest 并没有那么了解的原因,我无法正确写出对应的 test case,能给我一些帮助吗。
这是我尝试写的 test case,但是它好像并不符合预期
it('should be opened correctly when using dynamic maxCountTag and onDropdownVisibleChange', async () => { const onDropdownVisibleChange = jest.fn(); const Test = () => { const [isOpen, setIsOpen] = React.useState(false); return ( <Select mode="multiple" open={isOpen} onDropdownVisibleChange={(o) => { setIsOpen(o); onDropdownVisibleChange(); }} value={['1', '2']} maxTagCount={isOpen ? 0 : 'responsive'} <Option value="1">1</Option> <Option value="2">2</Option> <Option value="3">3</Option> <Option value="4">4</Option> </Select> ); }; const wrapper = mount(<Test />); wrapper.find('.rc-select-selection-overflow').simulate('mousedown'); expectOpen(wrapper); expect(onDropdownVisibleChange).toBeCalledTimes(1); });
fix Weird behavior when using dynamic maxCountTag. #42551