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

skeleton组件问题修复&测试用例完善 #1951

Merged
merged 8 commits into from
Feb 7, 2023

Conversation

lihuanIT
Copy link
Contributor

@lihuanIT lihuanIT commented Feb 7, 2023

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • fix(组件名称): 处理问题或特性描述 ...
  1. 不同loading状态处理骨架屏和内容展示情况
  2. rowCol 支持自定义任意 行数 和 列数
  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@lihuanIT lihuanIT changed the title Test skeleton skeleton组件问题修复&测试用例完善 Feb 7, 2023
>
<div
class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none"
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

这些元素没了,可能是 BUG,仔细确认下

expect(container.querySelector('.t-skeleton__row')).toBeFalsy();
await mockDelay(1000);
expect(container.querySelector('.t-skeleton__row')).toBeTruthy();
it('props.delay: show loading delay 10ms', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

手写的测试用例,放在单独的文件里面

@chaishi chaishi merged commit 5b64e93 into Tencent:20230115_test_skeleton Feb 7, 2023
// 骨架屏无需展示
if (!loading) {
// 加载时长超过delay时,需加载DEFAULT_DURATION时长的骨架屏
if (delay > 0 && loadingTime.current > delay) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这里当loading 变为false 的时候,是否触发 DEFAULT_DURATION 防闪烁效果,需要判断delay > 0 吗?是不是需要包含delay === 0 的情况呢? 按照目前的逻辑,会存在比如: 用户设置了delay 默认为0 ,期望出现骨架屏过渡,而加载时间可能是100ms ,也可能是10ms,10ms 的时候还是会出现闪烁现象的~

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

Successfully merging this pull request may close these issues.

4 participants