Add Android node foundation with FCM push support
This commit is contained in:
@@ -233,7 +233,7 @@ describe('protocol', () => {
|
||||
it('rejects invalid node push token params', () => {
|
||||
expect(parseNodePushTokenSetParams({
|
||||
connectionId: 'conn-1',
|
||||
provider: 'fcm',
|
||||
provider: 'webpush',
|
||||
token: 'abcd1234abcd1234abcd1234abcd1234',
|
||||
})).toBeNull();
|
||||
expect(parseNodePushTokenSetParams({
|
||||
@@ -247,6 +247,21 @@ describe('protocol', () => {
|
||||
token: 'abcd1234abcd1234abcd1234abcd1234',
|
||||
})).toBeNull();
|
||||
});
|
||||
|
||||
it('parses valid fcm token params for android nodes', () => {
|
||||
const parsed = parseNodePushTokenSetParams({
|
||||
connectionId: 'conn-2',
|
||||
provider: 'fcm',
|
||||
token: 'fcm_abcdefghijklmnopqrstuvwxyz123456',
|
||||
});
|
||||
expect(parsed).toEqual({
|
||||
connectionId: 'conn-2',
|
||||
provider: 'fcm',
|
||||
token: 'fcm_abcdefghijklmnopqrstuvwxyz123456',
|
||||
topic: undefined,
|
||||
environment: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('makeResponse', () => {
|
||||
|
||||
Reference in New Issue
Block a user