Skip to content

Commit bce9031

Browse files
committed
Add unit test case for contentChanged property
1 parent 31c70cf commit bce9031

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

test/unit/messaging/messaging.spec.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,7 @@ describe('Messaging', () => {
21922192
category: 'test.category',
21932193
contentAvailable: true,
21942194
mutableContent: true,
2195+
contentChanged: true,
21952196
threadId: 'thread.id',
21962197
},
21972198
customKey1: 'custom.value',
@@ -2229,6 +2230,7 @@ describe('Messaging', () => {
22292230
'category': 'test.category',
22302231
'content-available': 1,
22312232
'mutable-content': 1,
2233+
'content-changed': 1,
22322234
'thread-id': 'thread.id',
22332235
},
22342236
customKey1: 'custom.value',
@@ -2380,6 +2382,44 @@ describe('Messaging', () => {
23802382
},
23812383
},
23822384
},
2385+
{
2386+
label: 'APNS contentChanged explicitly false',
2387+
req: {
2388+
apns: {
2389+
payload: {
2390+
aps: {
2391+
contentChanged: false,
2392+
},
2393+
},
2394+
},
2395+
},
2396+
expectedReq: {
2397+
apns: {
2398+
payload: {
2399+
aps: {},
2400+
},
2401+
},
2402+
},
2403+
},
2404+
{
2405+
label: 'APNS contentChanged set explicitly',
2406+
req: {
2407+
apns: {
2408+
payload: {
2409+
aps: {
2410+
'content-changed': 1,
2411+
},
2412+
},
2413+
},
2414+
},
2415+
expectedReq: {
2416+
apns: {
2417+
payload: {
2418+
aps: { 'content-changed': 1 },
2419+
},
2420+
},
2421+
},
2422+
},
23832423
{
23842424
label: 'APNS custom fields',
23852425
req: {

0 commit comments

Comments
 (0)