Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
f660595e
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5998
Star
91
Fork
163
代码
文件
提交
分支
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看板
提交
f660595e
编写于
7月 03, 2024
作者:
DCloud_iOS_WZT
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of gitcode.net:dcloud/hello-uni-app-x into dev
上级
84e11430
5eb3edd0
变更
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
浏览文件 @
f660595e
const
PAGE_PATH
=
'
/pages/API/unicloud-database/unicloud-database
'
describe
(
'
unicloud-database
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
500
)
await
page
.
setData
({
isUniTest
:
true
})
})
it
(
'
databaseBasic
'
,
async
()
=>
{
await
page
.
callMethod
(
'
dbRemove
'
)
await
page
.
callMethod
(
'
dbAdd
'
)
await
page
.
callMethod
(
'
dbBatchAdd
'
)
await
page
.
callMethod
(
'
dbGet
'
)
await
page
.
callMethod
(
'
dbGetWithCommand
'
)
await
page
.
callMethod
(
'
dbUpdate
'
)
await
page
.
callMethod
(
'
dbRemove
'
)
await
page
.
callMethod
(
'
dbMultiSend
'
)
const
{
addId
,
batchAddIds
,
batchAddinserted
,
updateUpdated
,
getData
,
getWithCommandData
,
removeDeleted
,
multiSendSuccessCount
,
}
=
await
page
.
data
()
expect
(
addId
!==
''
).
toBe
(
true
)
expect
(
batchAddIds
.
length
).
toBe
(
2
)
expect
(
batchAddinserted
).
toBe
(
2
)
expect
(
getData
.
length
).
toBe
(
2
)
expect
(
getWithCommandData
.
length
).
toBe
(
1
)
expect
(
updateUpdated
).
toBe
(
3
)
expect
(
removeDeleted
).
toBe
(
3
)
expect
(
multiSendSuccessCount
).
toBe
(
2
)
})
it
(
'
databaseLookup
'
,
async
()
=>
{
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
)
})
});
const
PAGE_PATH
=
'
/pages/API/unicloud-database/unicloud-database
'
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isSafari
=
platformInfo
.
indexOf
(
'
safari
'
)
>
-
1
describe
(
'
unicloud-database
'
,
()
=>
{
if
(
isSafari
)
{
it
(
'
web safari 暂时规避
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
500
)
await
page
.
setData
({
isUniTest
:
true
})
})
it
(
'
databaseBasic
'
,
async
()
=>
{
await
page
.
callMethod
(
'
dbRemove
'
)
await
page
.
callMethod
(
'
dbAdd
'
)
await
page
.
callMethod
(
'
dbBatchAdd
'
)
await
page
.
callMethod
(
'
dbGet
'
)
await
page
.
callMethod
(
'
dbGetWithCommand
'
)
await
page
.
callMethod
(
'
dbUpdate
'
)
await
page
.
callMethod
(
'
dbRemove
'
)
await
page
.
callMethod
(
'
dbMultiSend
'
)
const
{
addId
,
batchAddIds
,
batchAddinserted
,
updateUpdated
,
getData
,
getWithCommandData
,
removeDeleted
,
multiSendSuccessCount
,
}
=
await
page
.
data
()
expect
(
addId
!==
''
).
toBe
(
true
)
expect
(
batchAddIds
.
length
).
toBe
(
2
)
expect
(
batchAddinserted
).
toBe
(
2
)
expect
(
getData
.
length
).
toBe
(
2
)
expect
(
getWithCommandData
.
length
).
toBe
(
1
)
expect
(
updateUpdated
).
toBe
(
3
)
expect
(
removeDeleted
).
toBe
(
3
)
expect
(
multiSendSuccessCount
).
toBe
(
2
)
})
it
(
'
databaseLookup
'
,
async
()
=>
{
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
浏览文件 @
f660595e
...
...
@@ -2,7 +2,8 @@ describe('list-view-children-in-slot', () => {
let
page
beforeAll
(
async
()
=>
{
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
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录