Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
c636abee
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
350
Star
2
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uvue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c636abee
编写于
7月 25, 2024
作者:
辛宝Otto
🥊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: watchEffect 在 iOS 表现行为和 web 对齐,抹平差异
上级
740a387d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
37 deletion
+6
-37
pages/reactivity/core/watch-effect/watch-effect.test.js
pages/reactivity/core/watch-effect/watch-effect.test.js
+4
-14
pages/reactivity/core/watch-post-effect/watch-post-effect.test.js
...activity/core/watch-post-effect/watch-post-effect.test.js
+1
-10
pages/reactivity/core/watch-sync-effect/watch-sync-effect.test.js
...activity/core/watch-sync-effect/watch-sync-effect.test.js
+1
-13
未找到文件。
pages/reactivity/core/watch-effect/watch-effect.test.js
浏览文件 @
c636abee
...
...
@@ -6,7 +6,6 @@ describe('watchEffect', () => {
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
const
isWeb
=
platformInfo
.
startsWith
(
'
web
'
)
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
...
...
@@ -22,10 +21,7 @@ describe('watchEffect', () => {
// track
const
watchCountTrackNum
=
await
page
.
$
(
'
#watch-count-track-num
'
)
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
11
'
)
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
6
'
)
}
...
...
@@ -46,8 +42,6 @@ describe('watchEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
19
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
9
'
)
}
...
...
@@ -64,9 +58,7 @@ describe('watchEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
27
'
)
}
else
{
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
12
'
)
}
expect
(
await
watchCountCleanupRes
.
text
()).
toBe
(
'
watch count cleanup: 2
'
)
...
...
@@ -85,9 +77,7 @@ describe('watchEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
27
'
)
}
else
{
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
12
'
)
}
expect
(
await
watchCountCleanupRes
.
text
()).
toBe
(
'
watch count cleanup: 2
'
)
...
...
@@ -157,4 +147,4 @@ describe('watchEffect', () => {
const
watchCountAndObjNumRes
=
await
page
.
$
(
'
#watch-count-obj-num-res
'
)
expect
(
await
watchCountAndObjNumRes
.
text
()).
toBe
(
'
count: 3, obj.num: 1
'
)
})
})
\ No newline at end of file
})
pages/reactivity/core/watch-post-effect/watch-post-effect.test.js
浏览文件 @
c636abee
...
...
@@ -24,9 +24,6 @@ describe('watchPostEffect', () => {
const
watchCountTrackNum
=
await
page
.
$
(
'
#watch-count-track-num
'
)
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
8
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
...
...
@@ -52,8 +49,6 @@ describe('watchPostEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
16
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
6
'
)
}
...
...
@@ -70,8 +65,6 @@ describe('watchPostEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
24
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
9
'
)
}
...
...
@@ -92,8 +85,6 @@ describe('watchPostEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
24
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
9
'
)
}
...
...
@@ -146,4 +137,4 @@ describe('watchPostEffect', () => {
const
watchCountAndObjNumRes
=
await
page
.
$
(
'
#watch-count-obj-num-res
'
)
expect
(
await
watchCountAndObjNumRes
.
text
()).
toBe
(
'
count: 3, obj.num: 1
'
)
})
})
\ No newline at end of file
})
pages/reactivity/core/watch-sync-effect/watch-sync-effect.test.js
浏览文件 @
c636abee
...
...
@@ -24,9 +24,6 @@ describe('watchSyncEffect', () => {
const
watchCountTrackNum
=
await
page
.
$
(
'
#watch-count-track-num
'
)
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
11
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
6
'
)
}
...
...
@@ -47,9 +44,6 @@ describe('watchSyncEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
19
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
9
'
)
}
...
...
@@ -66,9 +60,6 @@ describe('watchSyncEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
27
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
12
'
)
}
...
...
@@ -89,9 +80,6 @@ describe('watchSyncEffect', () => {
if
(
isAndroid
)
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
3
'
)
}
else
if
(
isIos
)
{
// TODO: 确认 IOS 的差异是否正常
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
27
'
)
}
else
{
expect
(
await
watchCountTrackNum
.
text
()).
toBe
(
'
12
'
)
}
...
...
@@ -144,4 +132,4 @@ describe('watchSyncEffect', () => {
const
watchCountAndObjNumRes
=
await
page
.
$
(
'
#watch-count-obj-num-res
'
)
expect
(
await
watchCountAndObjNumRes
.
text
()).
toBe
(
'
count: 3, obj.num: 1
'
)
})
})
\ No newline at end of file
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录