test(popconfirm): improve popconfirm test coverage - #6896
Open
zhangpaopao0609 wants to merge 1 commit into
Open
Conversation
zhangpaopao0609
requested review from
Cat1007,
PengYYYYY,
Wesley-0808,
chaishi,
liweijie0812,
uyarn and
zydemail
as code owners
August 8, 2026 13:23
This was referenced Aug 8, 2026
Closed
Contributor
|
Size Change: 0 B Total Size: 21.4 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 3.55 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 74.9 kB ℹ️ View Unchanged
|
Collaborator
TDesign Component Site Preview Open
|
commit: |
Contributor
|
Size Change: 0 B Total Size: 960 kB ℹ️ View Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
本 PR 仅重写 Popconfirm 测试,不修改组件源码。
原测试只有 1 个空名称用例,仅断言组件能够挂载;Popconfirm 的 props、String / Object / Function / Slot 多形态 TNode、Popup 属性透传、受控与非受控状态、v-model、事件上下文和生命周期均没有覆盖。
本次直接替换旧测试文件,重写为 40 个用例,覆盖:
cancelBtn、confirmBtn的 String / Object / Function / Slot / null 形态;content、default、icon、triggerElement的 String / Function / Slot 形态及优先级;destroyOnClose、全部placement、popupProps透传与覆盖顺序、showArrow、全部theme;visible、modelValue、defaultVisible三种状态模式;update:visible、update:modelValue;测试结构参照 Form 组件规范:顶层使用真实组件名,内部按
props、events、lifecycle组织;API 用例采用:prop[type]命名,String / Function / Slot 分开覆盖。旧测试被直接移除重写,没有快照或ts-nocheck。覆盖率结果:
popconfirm.tsx:Statements 94.62% → 100%,Branches 75% → 100%,Functions 57.14% → 100%,Lines 94.62% → 100%。props.ts:Statements 100%,Branches 50% → 100%,Functions 100%,Lines 100%。重写过程中确认
theme=""会通过 validator,但图标映射得到undefined,导致 Vue invalid vnode warning 且默认图标消失,详见 #6893。测试按当前真实行为断言,源码修复后会自然提醒同步更新。✅ 验证
pnpm exec tsc --noEmit--max-warnings 0pnpm lint📝 更新日志
☑️ 请求合并前的自查清单