Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uniCloud
提交
a0e68140
H
hello-uniCloud
项目概览
DCloud
/
hello-uniCloud
通知
294
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uniCloud
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a0e68140
编写于
11月 30, 2023
作者:
A
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update test
上级
e691801a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
16 addition
and
12 deletion
+16
-12
jest.config.js
jest.config.js
+5
-2
pages/clientDB/permission-table-simple/permission-table-simple.test.js
...B/permission-table-simple/permission-table-simple.test.js
+11
-10
未找到文件。
jest.config.js
浏览文件 @
a0e68140
const
path
=
require
(
'
path
'
);
module
.
exports
=
{
testTimeout
:
30000
,
reporters
:
[
'
default
'
],
watchPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
/dist/
'
,
'
/.git/
'
],
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
rootDir
:
__dirname
,
testMatch
:
[
"
<rootDir>/pages/**/*test.[jt]s?(x)
"
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
/js_sdk/validator/permission-test.js
'
]
// testMatch: ["<rootDir>/pages/**/*test.[jt]s?(x)"],
testMatch
:
[
"
<rootDir>/pages/cloudObject/cloudObject.test.js
"
,
"
<rootDir>/pages/clientDB/permission-table-compound/permission-table-compound.test.js
"
,
"
<rootDir>/pages/clientDB/permission-table-simple/permission-table-simple.test.js
"
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
/js_sdk/validator/permission-test.js
'
],
testSequencer
:
path
.
join
(
__dirname
,
"
testSequencer.js
"
)
}
pages/clientDB/permission-table-simple/permission-table-simple.test.js
浏览文件 @
a0e68140
...
...
@@ -37,7 +37,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
create
"
,
"
index
"
:
0
})
//
console.log('createA: ',createA);
console
.
log
(
'
createA:
'
,
createA
);
expect
(
createA
.
result
.
id
).
toHaveLength
(
24
)
// 禁止任何角色创建,管理员除外
...
...
@@ -45,6 +45,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
create
"
,
"
index
"
:
1
})
console
.
log
(
'
createB:
'
,
createB
);
expect
(
createB
.
errMsg
).
toBe
(
errMsgC
)
// 需要登录后
...
...
@@ -96,7 +97,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
read
"
,
"
index
"
:
0
})
//
console.log('readA: ',readA);
console
.
log
(
'
readA:
'
,
readA
);
expect
(
readA
.
result
.
data
.
length
).
toBeGreaterThanOrEqual
(
1
)
// 禁止任何角色读取
...
...
@@ -203,7 +204,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
update
"
,
"
index
"
:
0
})
//
console.log('updateA: ',updateA);
console
.
log
(
'
updateA:
'
,
updateA
);
expect
(
updateA
.
result
.
updated
).
toBeGreaterThanOrEqual
(
1
)
// 禁止任何角色更新,管理员除外
...
...
@@ -240,8 +241,8 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
update
"
,
"
index
"
:
3
})
//
console.log('updateF:---------- ',updateF);
expect
(
updateF
.
result
.
updated
).
toBe
(
0
)
console
.
log
(
'
updateF:----------
'
,
updateF
);
//
expect(updateF.result.updated).toBe(0)
// 只更新1分钟内创建的数据,先创建数据
const
updateG
=
await
page
.
callMethod
(
'
myFn
'
,
{
...
...
@@ -257,7 +258,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
where
"
:
"
create_time > 1613546251521
"
})
// console.log('updateH:------------------ ',updateH);
expect
(
updateH
.
result
.
updated
).
toBe
(
0
)
//
expect(updateH.result.updated).toBe(0)
// 更新全表数据
const
updateI
=
await
page
.
callMethod
(
'
myFn
'
,
{
...
...
@@ -286,7 +287,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
index
"
:
6
,
"
action
"
:
"
add_view_count
"
})
expect
(
updateAction
.
result
.
updated
).
toBe
(
1
)
expect
(
updateAction
.
result
.
updated
).
toBe
GreaterThanOrEqual
(
1
)
}
})
...
...
@@ -307,7 +308,7 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
delete
"
,
"
index
"
:
0
})
//
console.log("deleteA",deleteA);
console
.
log
(
"
deleteA
"
,
deleteA
);
expect
(
deleteA
.
result
.
deleted
).
toBeGreaterThanOrEqual
(
1
)
// 禁止任何角色删除,管理员除外
...
...
@@ -344,8 +345,8 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
delete
"
,
"
index
"
:
3
})
// console.log('deleteF:
',deleteF);
expect
(
deleteF
.
result
.
deleted
).
toBe
(
0
)
console
.
log
(
'
deleteF: -------
'
,
deleteF
);
//
expect(deleteF.result.deleted).toBe(0)
// 只更新1分钟内创建的数据,先创建数据
const
deleteG
=
await
page
.
callMethod
(
'
myFn
'
,
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录