Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7f36a04c
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7f36a04c
编写于
8月 04, 2022
作者:
Z
zhijianwen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show
Signed-off-by:
N
zhijianwen
<
zhijianwen@huawei.com
>
上级
5fd1c9d3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
179 addition
and
186 deletion
+179
-186
notification/ans_standard/actsnotificationshow/src/main/js/test/ActsNotificationShowTest.js
...ficationshow/src/main/js/test/ActsNotificationShowTest.js
+179
-186
未找到文件。
notification/ans_standard/actsnotificationshow/src/main/js/test/ActsNotificationShowTest.js
浏览文件 @
7f36a04c
...
...
@@ -12,31 +12,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
notification
from
'
@system.notification
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
ActsNotificationShowTest
()
{
describe
(
'
ActsNotificationShowTest
'
,
function
()
{
console
.
info
(
"
ActsNotificationShowTest start
"
);
describe
(
'
ActsNotificationShowTest
'
,
function
()
{
const
TAG
=
'
ActsNotificationShowTest ===>
'
console
.
info
(
TAG
+
"
ActsNotificationShowTest START
"
)
/*
* @tc.number: ActsNotificationShowTest_0100
* @tc.name: show()
* @tc.desc: verify the function of show
*/
/*
* @tc.number: ActsNotificationShowTest_0100
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0100
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title1
'
,
contentText
:
'
This is a notification 001
'
}
notification
.
show
(
ShowNotificationOptions
);
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title1
'
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 001
'
);
console
.
log
(
'
ActsNotificationShowTest_0100 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
contentText
);
done
();
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0100 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title1
'
,
contentText
:
'
This is a notification 001
'
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title1
'
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 001
'
)
done
()
})
/*
...
...
@@ -45,19 +45,16 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0200
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
123
,
contentText
:
'
This is a notification 002
'
}
notification
.
show
(
ShowNotificationOptions
);
if
(
ShowNotificationOptions
.
contentTitle
==
123
){
console
.
log
(
'
ActsNotificationShowTest_0200 conteneTitle is number:
'
+
ShowNotificationOptions
.
contentTitle
);
}
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 002
'
);
console
.
log
(
'
ActsNotificationShowTest_0200 success
'
+
ShowNotificationOptions
.
contentText
);
done
();
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0200 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
123
,
contentText
:
'
This is a notification 002
'
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle is number:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 002
'
)
done
()
})
/*
...
...
@@ -66,11 +63,11 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0300
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{}
notification
.
show
(
ShowNotificationOptions
);
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
undefined
);
console
.
log
(
'
ActsNotificationShowTest_0300 success
'
);
done
();
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0300 START
'
)
let
ShowNotificationOptions
=
{}
notification
.
show
(
ShowNotificationOptions
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
undefined
)
done
()
})
/*
...
...
@@ -79,28 +76,28 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0400
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title4
'
,
contentText
:
'
This is a notification 00
4
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0400 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title
4
'
,
contentText
:
'
This is a notification 004
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
notification
.
show
(
ShowNotificationOptions
);
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title4
'
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 004
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
);
console
.
log
(
'
ActsNotificationShowTest_0400 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
contentText
+
ShowNotificationOptions
.
ActionResult
.
bundleName
+
ShowNotificationOptions
.
ActionResult
.
abilityName
+
ShowNotificationOptions
.
ActionResult
.
uri
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title4
'
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 004
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
)
done
()
})
/*
...
...
@@ -109,28 +106,28 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0500
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title5
'
,
contentText
:
'
This is a notification 00
5
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
pages/index/index
'
,
}
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0500 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title
5
'
,
contentText
:
'
This is a notification 005
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
pages/index/index
'
,
}
notification
.
show
(
ShowNotificationOptions
);
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title5
'
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 005
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
pages/index/index
'
);
console
.
log
(
'
ActsNotificationShowTest_0500 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
contentText
+
ShowNotificationOptions
.
ActionResult
.
bundleName
+
ShowNotificationOptions
.
ActionResult
.
abilityName
+
ShowNotificationOptions
.
ActionResult
.
uri
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title5
'
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 005
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
pages/index/index
'
)
done
()
})
/*
...
...
@@ -139,30 +136,27 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0600
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title6
'
,
contentText
:
'
This is a notification 00
6
'
,
ActionResult
:
{
bundleName
:
''
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0600 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title
6
'
,
contentText
:
'
This is a notification 006
'
,
ActionResult
:
{
bundleName
:
''
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
notification
.
show
(
ShowNotificationOptions
);
if
(
ShowNotificationOptions
.
ActionResult
.
bundleName
==
''
){
console
.
log
(
'
ActsNotificationShowTest_0200 bundleName is null:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
);
}
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title6
'
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 006
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
);
console
.
log
(
'
ActsNotificationShowTest_0600 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
contentText
+
ShowNotificationOptions
.
ActionResult
.
abilityName
+
ShowNotificationOptions
.
ActionResult
.
uri
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title6
'
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 006
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
)
done
()
})
/*
...
...
@@ -171,30 +165,27 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0700
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title7
'
,
contentText
:
'
This is a notification 007
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
''
,
uri
:
'
/
'
,
}
}
notification
.
show
(
ShowNotificationOptions
);
if
(
ShowNotificationOptions
.
ActionResult
.
abilityName
==
''
){
console
.
log
(
'
ActsNotificationShowTest_0200 abilityName is null:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
);
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0700 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title7
'
,
contentText
:
'
This is a notification 007
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
''
,
uri
:
'
/
'
,
}
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title7
'
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 007
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
);
console
.
log
(
'
ActsNotificationShowTest_0700 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
contentText
+
ShowNotificationOptions
.
ActionResult
.
bundleName
+
ShowNotificationOptions
.
ActionResult
.
uri
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title7
'
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 007
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
)
done
()
})
/*
...
...
@@ -203,29 +194,27 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0800
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title8
'
,
contentText
:
'
This is a notification 00
8
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
''
,
}
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0800 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title
8
'
,
contentText
:
'
This is a notification 008
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
''
,
}
notification
.
show
(
ShowNotificationOptions
);
if
(
ShowNotificationOptions
.
ActionResult
.
uri
==
''
){
console
.
log
(
'
ActsNotificationShowTest_0200 uri is null:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
);
}
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title8
'
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 008
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
);
console
.
log
(
'
ActsNotificationShowTest_0800 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
contentText
+
ShowNotificationOptions
.
ActionResult
.
bundleName
+
ShowNotificationOptions
.
ActionResult
.
abilityName
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title8
'
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 008
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
)
done
()
})
/*
...
...
@@ -234,25 +223,25 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_0900
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentText
:
'
This is a notification 009
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
console
.
info
(
TAG
+
'
ActsNotificationShowTest_0900 START
'
)
let
ShowNotificationOptions
=
{
contentText
:
'
This is a notification 009
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
notification
.
show
(
ShowNotificationOptions
);
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 009
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
);
console
.
log
(
'
ActsNotificationShowTest_0900 success
'
+
ShowNotificationOptions
.
contentText
+
ShowNotificationOptions
.
ActionResult
.
bundleName
+
ShowNotificationOptions
.
ActionResult
.
abilityName
+
ShowNotificationOptions
.
ActionResult
.
uri
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
contentText:
'
+
ShowNotificationOptions
.
contentText
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentText
).
assertEqual
(
'
This is a notification 009
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
)
done
()
})
/*
...
...
@@ -261,26 +250,30 @@ describe('ActsNotificationShowTest', function () {
* @tc.desc: verify the function of show
*/
it
(
'
ActsNotificationShowTest_1000
'
,
0
,
async
function
(
done
)
{
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title10
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
console
.
info
(
TAG
+
'
ActsNotificationShowTest_1000 START
'
)
let
ShowNotificationOptions
=
{
contentTitle
:
'
Title10
'
,
ActionResult
:
{
bundleName
:
'
com.example.notification
'
,
abilityName
:
'
com.example.notification.MainAbility
'
,
uri
:
'
/
'
,
}
notification
.
show
(
ShowNotificationOptions
);
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title10
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
);
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
);
console
.
log
(
'
ActsNotificationShowTest_1000 success
'
+
ShowNotificationOptions
.
contentTitle
+
ShowNotificationOptions
.
ActionResult
.
bundleName
+
ShowNotificationOptions
.
ActionResult
.
abilityName
+
ShowNotificationOptions
.
ActionResult
.
uri
);
done
();
}
notification
.
show
(
ShowNotificationOptions
)
console
.
info
(
TAG
+
'
conteneTitle:
'
+
ShowNotificationOptions
.
contentTitle
)
console
.
info
(
TAG
+
'
ActionResult bundleName:
'
+
ShowNotificationOptions
.
ActionResult
.
bundleName
)
console
.
info
(
TAG
+
'
ActionResult abilityName:
'
+
ShowNotificationOptions
.
ActionResult
.
abilityName
)
console
.
info
(
TAG
+
'
ActionResult uri:
'
+
ShowNotificationOptions
.
ActionResult
.
uri
)
expect
(
ShowNotificationOptions
.
contentTitle
).
assertEqual
(
'
Title10
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
bundleName
).
assertEqual
(
'
com.example.notification
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
abilityName
).
assertEqual
(
'
com.example.notification.MainAbility
'
)
expect
(
ShowNotificationOptions
.
ActionResult
.
uri
).
assertEqual
(
'
/
'
)
done
()
})
})
console
.
info
(
TAG
+
"
ActsNotificationShowTest END
"
);
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录