diff --git a/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts index 760057fd4..2dd8946f7 100644 --- a/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts +++ b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts @@ -676,7 +676,7 @@ export class PushNotificationBaseClass { notificationSettingDescription = notificationSettingDescription + SETTING_SEPARATOR + ele.description; } - if (ele.type == 1) { + if (ele.type == SLIDER_TYPE) { if (ele.data) { const enabled = (ele.data && ele.data.enabled != undefined) ? Number(ele.data.enabled).toString() : DEFAULT_ENABLE_VALUE const ticker = ele.data.ticker ?? DEFAULT_TICKER_VALUE diff --git a/packages/restapi/tests/lib/pushNotification/channel.test.ts b/packages/restapi/tests/lib/pushNotification/channel.test.ts index 677d4ac8d..6d06bba64 100644 --- a/packages/restapi/tests/lib/pushNotification/channel.test.ts +++ b/packages/restapi/tests/lib/pushNotification/channel.test.ts @@ -288,8 +288,9 @@ describe('PushAPI.channel functionality', () => { describe.skip('channel :: settings', () => { it('Should create channel', async () => { const res = await userKate.channel.setting([ + {type: 2, default: 5, description: "My notif setting 2", data: {upper:100, lower:5, ticker: 10, enabled: true}}, { type: 1, default: 1, description: 'My Notif Settings' }, - {type: 2, default: 5, description: "My notif setting 2", data: {upper:100, lower:5, ticker: 10}} + ]); // console.log(res) expect(res).not.null; diff --git a/packages/restapi/tests/lib/pushNotification/onchain.test.ts b/packages/restapi/tests/lib/pushNotification/onchain.test.ts index faaf15126..b26a7a2cc 100644 --- a/packages/restapi/tests/lib/pushNotification/onchain.test.ts +++ b/packages/restapi/tests/lib/pushNotification/onchain.test.ts @@ -125,30 +125,28 @@ // ); // console.log(approveRes2); // }); -// it.only('Should get proper minnimal payload', async() => { -// const inputData = [ -// { -// type: 0, -// default: 1, -// description: 'test1', -// }, -// { -// type: 1, -// default: 10, -// description: 'test2', -// data: { -// upper: 100, -// lower: 1, - -// ticker: 10 -// }, -// }, -// ]; -// const account2 = await signer2.getAddress(); -// const userAlice = new PushNotificationBaseClass(signer2, ENV.STAGING, account2,); -// const minimalSettings = userAlice.getMinimalSetting(inputData); -// console.log(minimalSettings); -// }); + // it.only('Should get proper minnimal payload', async() => { + // const inputData = [ + // { + // type: 1, + // default: 1, + // description: 'test1', + // }, + // { + // type: 2, + // default: 10, + // description: 'test2', + // data: { + // upper: 100, + // lower: 1, + // }, + // }, + // ]; + // const account2 = await signer2.getAddress(); + // const userAlice = new PushNotificationBaseClass(signer2, ENV.STAGING, account2,); + // const minimalSettings = userAlice.getMinimalSetting(inputData); + // console.log(minimalSettings); + // }); // it.only('Should get proper minnimal payload', async() => { // const inputData = [