Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
5eb3edd0
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6013
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5eb3edd0
编写于
7月 03, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 针对 web 平台调整部分测试
上级
ad75be20
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
56 deletion
+65
-56
pages/API/unicloud-database/unicloud-database.test.js
pages/API/unicloud-database/unicloud-database.test.js
+63
-55
pages/component/list-view/list-view-children-in-slot.test.js
pages/component/list-view/list-view-children-in-slot.test.js
+2
-1
未找到文件。
pages/API/unicloud-database/unicloud-database.test.js
浏览文件 @
5eb3edd0
const
PAGE_PATH
=
'
/pages/API/unicloud-database/unicloud-database
'
const
PAGE_PATH
=
'
/pages/API/unicloud-database/unicloud-database
'
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
describe
(
'
unicloud-database
'
,
()
=>
{
const
isSafari
=
platformInfo
.
indexOf
(
'
safari
'
)
>
-
1
let
page
beforeAll
(
async
()
=>
{
describe
(
'
unicloud-database
'
,
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
if
(
isSafari
)
{
await
page
.
waitFor
(
500
)
it
(
'
web safari 暂时规避
'
,
()
=>
{
await
page
.
setData
({
expect
(
1
).
toBe
(
1
)
isUniTest
:
true
})
})
return
})
}
it
(
'
databaseBasic
'
,
async
()
=>
{
let
page
await
page
.
callMethod
(
'
dbRemove
'
)
beforeAll
(
async
()
=>
{
await
page
.
callMethod
(
'
dbAdd
'
)
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
callMethod
(
'
dbBatchAdd
'
)
await
page
.
waitFor
(
500
)
await
page
.
callMethod
(
'
dbGet
'
)
await
page
.
setData
({
await
page
.
callMethod
(
'
dbGetWithCommand
'
)
isUniTest
:
true
await
page
.
callMethod
(
'
dbUpdate
'
)
})
await
page
.
callMethod
(
'
dbRemove
'
)
})
await
page
.
callMethod
(
'
dbMultiSend
'
)
it
(
'
databaseBasic
'
,
async
()
=>
{
await
page
.
callMethod
(
'
dbRemove
'
)
const
{
await
page
.
callMethod
(
'
dbAdd
'
)
addId
,
await
page
.
callMethod
(
'
dbBatchAdd
'
)
batchAddIds
,
await
page
.
callMethod
(
'
dbGet
'
)
batchAddinserted
,
await
page
.
callMethod
(
'
dbGetWithCommand
'
)
updateUpdated
,
await
page
.
callMethod
(
'
dbUpdate
'
)
getData
,
await
page
.
callMethod
(
'
dbRemove
'
)
getWithCommandData
,
await
page
.
callMethod
(
'
dbMultiSend
'
)
removeDeleted
,
multiSendSuccessCount
,
const
{
}
=
await
page
.
data
()
addId
,
batchAddIds
,
expect
(
addId
!==
''
).
toBe
(
true
)
batchAddinserted
,
expect
(
batchAddIds
.
length
).
toBe
(
2
)
updateUpdated
,
expect
(
batchAddinserted
).
toBe
(
2
)
getData
,
expect
(
getData
.
length
).
toBe
(
2
)
getWithCommandData
,
expect
(
getWithCommandData
.
length
).
toBe
(
1
)
removeDeleted
,
expect
(
updateUpdated
).
toBe
(
3
)
multiSendSuccessCount
,
expect
(
removeDeleted
).
toBe
(
3
)
}
=
await
page
.
data
()
expect
(
multiSendSuccessCount
).
toBe
(
2
)
expect
(
addId
!==
''
).
toBe
(
true
)
})
expect
(
batchAddIds
.
length
).
toBe
(
2
)
expect
(
batchAddinserted
).
toBe
(
2
)
it
(
'
databaseLookup
'
,
async
()
=>
{
expect
(
getData
.
length
).
toBe
(
2
)
await
page
.
callMethod
(
'
dbLookupInit
'
)
expect
(
getWithCommandData
.
length
).
toBe
(
1
)
await
page
.
callMethod
(
'
dbLookup
'
)
expect
(
updateUpdated
).
toBe
(
3
)
expect
(
removeDeleted
).
toBe
(
3
)
const
{
expect
(
multiSendSuccessCount
).
toBe
(
2
)
lookupData
}
=
await
page
.
data
()
})
expect
(
lookupData
.
length
).
toBe
(
2
)
expect
(
lookupData
[
0
][
'
foreign_id
'
].
length
).
toBe
(
1
)
it
(
'
databaseLookup
'
,
async
()
=>
{
expect
(
lookupData
[
1
][
'
foreign_id
'
].
length
).
toBe
(
1
)
await
page
.
callMethod
(
'
dbLookupInit
'
)
})
await
page
.
callMethod
(
'
dbLookup
'
)
});
const
{
lookupData
}
=
await
page
.
data
()
expect
(
lookupData
.
length
).
toBe
(
2
)
expect
(
lookupData
[
0
][
'
foreign_id
'
].
length
).
toBe
(
1
)
expect
(
lookupData
[
1
][
'
foreign_id
'
].
length
).
toBe
(
1
)
})
});
pages/component/list-view/list-view-children-in-slot.test.js
浏览文件 @
5eb3edd0
...
@@ -2,7 +2,8 @@ describe('list-view-children-in-slot', () => {
...
@@ -2,7 +2,8 @@ describe('list-view-children-in-slot', () => {
let
page
let
page
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-children-in-slot
'
)
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-children-in-slot
'
)
await
page
.
waitFor
(
'
list-view
'
)
await
page
.
waitFor
(
'
list-view
'
)
await
page
.
waitFor
(
300
)
})
})
it
(
'
basic
'
,
async
()
=>
{
it
(
'
basic
'
,
async
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录