From 5847579399553abfb8204d3953b7e24ac01aac73 Mon Sep 17 00:00:00 2001 From: fjr Date: Thu, 14 Jul 2022 17:57:42 +0800 Subject: [PATCH] 4fail Signed-off-by: fjr --- .../src/main/js/test/ExampleJsunit.test.js | 11 ++-- .../publishcontentype/publishtype/Test.json | 2 +- .../src/main/js/test/ExampleJsunit.test.js | 54 +++++++++---------- .../entry/src/main/js/test/Subscriber.js | 4 +- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js index 180d200dc..31eb3730f 100755 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js @@ -181,7 +181,7 @@ describe('ActsAnsAddSlotSystem', function () { function getSlotCallback(err, data) { console.debug("====>ActsAnsAddSlotSystem_0400 enter====>"); console.debug("====>getSlot 0400 err:" + JSON.stringify(err)); - // expect(err.code).assertEqual(0); + expect(err.code).assertEqual(0); console.debug("====>getSlot 0400 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); @@ -194,7 +194,7 @@ describe('ActsAnsAddSlotSystem', function () { expect(data.lightColor).assertEqual(4); notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ console.debug("====>removeSlot ActsAnsAddSlotSystem_0400 err====>" + JSON.stringify(err)); - // expect(err.code).assertEqual(0); + expect(err.code).assertEqual(0); done(); }) } @@ -213,10 +213,11 @@ describe('ActsAnsAddSlotSystem', function () { }, (err)=>{ console.debug("====>addSlot OTHER_TYPES callback====>"); - // expect(err.code).assertEqual(0); + expect(err.code).assertEqual(0); + notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallback); }) console.debug("====>getSlot SlotType.OTHER_TYPES====>"); - notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallback); + setTimeout(function(){ console.debug("====>time out ActsAnsAddSlotSystem_0400====>"); }, TIMEOUT); @@ -404,7 +405,7 @@ describe('ActsAnsAddSlotSystem', function () { it('ActsAnsAddSlotSystem_0900', 0, async function (done) { console.debug("====>ActsAnsAddSlotSystem_0900 start====>"); console.debug("====>addSlot OTHER_TYPES====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.OTHER_TYPES, level: notification.SlotLevel.LEVEL_DEFAULT, diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json index e8c76a7ea..aacba63d7 100644 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json @@ -9,7 +9,7 @@ "kits": [ { "test-file-name": [ - "ActsAnsNotificationTest" + "ActsAnsNotificationTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js index 6fe34ca08..a5739f88b 100644 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js @@ -279,7 +279,7 @@ describe('ActsAnsNotificationTest', function () { var notificationInfo = { id: 2, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, + contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, multiLine: { title: "test_title", text: "test_text", @@ -373,7 +373,7 @@ describe('ActsAnsNotificationTest', function () { var promise = notification.publish({ id: 5, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, + contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, multiLine: { title: "test_title", text: "test_text", @@ -384,7 +384,7 @@ describe('ActsAnsNotificationTest', function () { }, } }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); setTimeout(function(){ console.debug("====>time out ACTS_PublishMULTILINEContent_0500====>"); @@ -400,18 +400,18 @@ describe('ActsAnsNotificationTest', function () { var promise = notification.publish({ id: 6, content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, + contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, multiLine: { title: "test_title", text: "test_text", additionalText: "test_additionalText", briefText:"briefText", longTitle:"longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] + lines: ["thrive", "civilization", "harmonious"] }, } }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); setTimeout(function(){ console.debug("====>time out ACTS_PublishMULTILINEContent_0600====>"); @@ -470,7 +470,7 @@ describe('ActsAnsNotificationTest', function () { await notification.publish({ id: 8, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, longText: { title: "test_title", text: "test_text", @@ -490,13 +490,13 @@ describe('ActsAnsNotificationTest', function () { /* * @tc.number: ACTS_PublishLONGContent_0300 * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MEDIA) + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) */ it('ACTS_PublishLONGContent_0300', 0,async function (done) { await notification.publish({ id: 9, content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA, + contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, longText: { title: "test_title", text: "test_text", @@ -566,7 +566,7 @@ describe('ActsAnsNotificationTest', function () { var promise = await notification.publish({ id: 11, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, longText: { title: "test_title", text: "test_text", @@ -576,30 +576,30 @@ describe('ActsAnsNotificationTest', function () { expandedTitle:"expandedTitle" }} }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); }) /* * @tc.number: ACTS_PublishLONGContent_0600 * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MEDIA) promise + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) promise */ it('ACTS_PublishLONGContent_0600', 0,async function (done) { var promise = notification.publish({ id: 12, content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA, + contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, longText: { title: "test_title", text: "test_text", additionalText: "test_additionalText", longText:"longText", briefText:"briefText", - expandedTitle:"expandedTitle" + expandedTitle:"expandedTitleing" }} }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); }) @@ -657,7 +657,7 @@ describe('ActsAnsNotificationTest', function () { await notification.publish({ id: 14, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -816,7 +816,7 @@ describe('ActsAnsNotificationTest', function () { var promise = notification.publish({ id: 18, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -825,7 +825,7 @@ describe('ActsAnsNotificationTest', function () { }, slotType:notification.SlotType.CONTENT_INFORMATION }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); setTimeout(function(){ console.debug("====>time out ACTS_Publish_SlotTypeContent_0600====>"); @@ -974,7 +974,7 @@ describe('ActsAnsNotificationTest', function () { await notification.publish({ id:22, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -1133,7 +1133,7 @@ describe('ActsAnsNotificationTest', function () { var promise = notification.publish({ id:26, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -1142,7 +1142,7 @@ describe('ActsAnsNotificationTest', function () { slotType:notification.SlotType.OTHER_TYPES } }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); setTimeout(function(){ console.debug("====>time out ACTS_PublishSlotTypeOther_0600====>"); @@ -1291,7 +1291,7 @@ describe('ActsAnsNotificationTest', function () { await notification.publish({ id: 30, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -1450,7 +1450,7 @@ describe('ActsAnsNotificationTest', function () { var promise = notification.publish({ id: 34, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -1459,7 +1459,7 @@ describe('ActsAnsNotificationTest', function () { }, slotType:notification.SlotType.SERVICE_INFORMATION }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); setTimeout(function(){ console.debug("====>time out ACTS_PublishSlotTypeService_0600====>"); @@ -1608,7 +1608,7 @@ describe('ActsAnsNotificationTest', function () { await notification.publish({ id: 38, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -1767,7 +1767,7 @@ describe('ActsAnsNotificationTest', function () { var promise = notification.publish({ id: 42, content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test_title", text: "test_text", @@ -1776,7 +1776,7 @@ describe('ActsAnsNotificationTest', function () { slotType:notification.SlotType.SOCIAL_COMMUNICATION } }) - expect(promise).assertEqual(undefined) + expect(typeof(promise)).assertEqual("object") done(); setTimeout(function(){ console.debug("====>time out ACTS_PublishSlotTypeSocial_0600====>"); diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js index 0566b0c01..61fab0174 100644 --- a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js +++ b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js @@ -364,7 +364,7 @@ describe('ActsAnsSubscriberTest', function () { }) /* - * @tc.number: ActsSubscriber_test_0700 + * @tc.number: ActsSubscriber_test_0600 * @tc.name: subscribe() * @tc.desc: verify the function of subscribe */ @@ -480,7 +480,7 @@ describe('ActsAnsSubscriberTest', function () { onConnect:connectCallbacko, onDisconnect:disconnectCallbacko, } - await notify.subscribe(subInfo,{bundleNames:[]},subscribeCallbackp); + await notify.subscribe(subInfo,{bundleNames:[""]},subscribeCallbackp); await notify.unsubscribe(subInfo, unSubscribeCallbacko); console.debug("==ActsSubscriber_test_1400==end==>"); done(); -- GitLab