diff --git a/packages/restapi/tests/lib/chat/chat.test.ts b/packages/restapi/tests/lib/chat/chat.test.ts index 87433a7fb..57307404d 100644 --- a/packages/restapi/tests/lib/chat/chat.test.ts +++ b/packages/restapi/tests/lib/chat/chat.test.ts @@ -48,6 +48,7 @@ describe('PushAPI.chat functionality', () => { const userBobReadOnly = await PushAPI.initialize({ account: account, + env, }); const response = await userBobReadOnly.chat.list('REQUESTS', { diff --git a/packages/restapi/tests/lib/notification/delegate.test.ts b/packages/restapi/tests/lib/notification/delegate.test.ts index ae517abe0..b20898a6f 100644 --- a/packages/restapi/tests/lib/notification/delegate.test.ts +++ b/packages/restapi/tests/lib/notification/delegate.test.ts @@ -105,42 +105,7 @@ describe('PushAPI.delegate functionality', () => { }); it('With viem signer: Should add delegate', async () => { - // create polygon mumbai provider - const provider = (ethers as any).providers - ? new (ethers as any).providers.JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ) - : new (ethers as any).JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ); - signer2 = new ethers.Wallet( - `0x${process.env['WALLET_PRIVATE_KEY']}`, - provider - ); - userKate = await PushAPI.initialize(signer2); - const res = await userKate.channel.delegate.add( - '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' - ); - console.log(res); - expect(res).not.null; - }, 10000000); - - it('With viem signer: Should add delegate', async () => { - // create polygon mumbai provider - const provider = (ethers as any).providers - ? new (ethers as any).providers.JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ) - : new (ethers as any).JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ); - - signer2 = new ethers.Wallet( - `0x${process.env['WALLET_PRIVATE_KEY']}`, - provider - ); - userKate = await PushAPI.initialize(signer2); - const res = await userKate.channel.delegate.add( + const res = await viemUser.channel.delegate.add( '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); console.log(res); @@ -148,22 +113,8 @@ describe('PushAPI.delegate functionality', () => { }, 10000000); it('With viem signer: Should add delegate', async () => { - // create polygon mumbai provider - const provider = (ethers as any).providers - ? new (ethers as any).providers.JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ) - : new (ethers as any).JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ); - - signer2 = new ethers.Wallet( - `0x${process.env['WALLET_PRIVATE_KEY']}`, - provider - ); - userKate = await PushAPI.initialize(signer2); - const res = await userKate.channel.delegate.add( - 'eip155:80001:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + const res = await viemUser.channel.delegate.add( + 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); // console.log(res); expect(res).not.null; @@ -205,21 +156,8 @@ describe('PushAPI.delegate functionality', () => { }); it('With viem signer: Should remove delegate', async () => { - // create polygon mumbai provider - const provider = (ethers as any).providers - ? new (ethers as any).providers.JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ) - : new (ethers as any).JsonRpcProvider( - 'https://rpc-mumbai.maticvigil.com/v1' - ); - signer2 = new ethers.Wallet( - `0x${process.env['WALLET_PRIVATE_KEY']}`, - provider - ); - userKate = await PushAPI.initialize(signer2); - const res = await userKate.channel.delegate.remove( - 'eip155:80001:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + const res = await viemUser.channel.delegate.remove( + 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); // console.log(res); expect(res).not.null; diff --git a/packages/restapi/tests/lib/notification/notification.test.ts b/packages/restapi/tests/lib/notification/notification.test.ts index 78fc5cba8..da39e2add 100644 --- a/packages/restapi/tests/lib/notification/notification.test.ts +++ b/packages/restapi/tests/lib/notification/notification.test.ts @@ -252,7 +252,6 @@ describe('PushAPI.notification functionality', () => { it('Signer with no account: Should return response', async () => { const response = await userAlice.notification.subscriptions(); - console.log(response); expect(response).not.null; }); @@ -260,7 +259,6 @@ describe('PushAPI.notification functionality', () => { const response = await userAlice.notification.subscriptions({ account: 'eip155:80001:0xD8634C39BBFd4033c0d3289C4515275102423681', }); - // console.log(response); expect(response).not.null; expect(response.length).not.equal(0); }); @@ -287,7 +285,7 @@ describe('PushAPI.notification functionality', () => { const response = await userKate.notification.subscriptions({ account: '0xD8634C39BBFd4033c0d3289C4515275102423681', raw: false, - channel: "0xD8634C39BBFd4033c0d3289C4515275102423681" + channel: '0xD8634C39BBFd4033c0d3289C4515275102423681', }); // console.log(JSON.stringify(response)); expect(response).not.null; diff --git a/packages/restapi/tests/lib/progressHook/progressHookData.ts b/packages/restapi/tests/lib/progressHook/progressHookData.ts index fe48a655e..de17aeff3 100644 --- a/packages/restapi/tests/lib/progressHook/progressHookData.ts +++ b/packages/restapi/tests/lib/progressHook/progressHookData.ts @@ -12,7 +12,7 @@ const PROGRESSHOOK: Record< progressId: 'PUSH-CREATE-01', progressTitle: 'Generating Secure Profile Signature', progressInfo: - 'This step is only done for first time users and might take a few seconds. PGP keys are getting generated to provide you with secure yet seamless chat', + 'This step is only done for first time users and might take a few seconds. PGP keys are getting generated to provide you with secure yet seamless web3 communication', level: 'INFO', }, 'PUSH-CREATE-02': { @@ -32,7 +32,7 @@ const PROGRESSHOOK: Record< progressId: 'PUSH-CREATE-04', progressTitle: 'Syncing Generated Profile', progressInfo: - 'Please sign the message to continue. Steady lads, chat is almost ready!', + 'Please sign the message to continue. Great job! You are almost fully onboarded to Push Protocol!', level: 'INFO', }, 'PUSH-CREATE-05': { @@ -58,7 +58,7 @@ const PROGRESSHOOK: Record< progressId: 'PUSH-UPGRADE-02', progressTitle: 'Decrypting Old Profile', progressInfo: - 'Trying to Upgrade Push Chat Keys to latest version. Please sign the message to continue.', + 'Trying to Upgrade Push Keys to latest version. Please sign the message to continue.', level: 'INFO', }, /** @@ -83,7 +83,7 @@ const PROGRESSHOOK: Record< }, 'PUSH-UPGRADE-05': { progressId: 'PUSH-UPGRADE-05', - progressTitle: 'Upgrade Completed, Welcome to Push Chat', + progressTitle: 'Upgrade Completed, Welcome to Push Protocol', progressInfo: '', level: 'SUCCESS', }, @@ -109,7 +109,7 @@ const PROGRESSHOOK: Record< return { progressId: 'PUSH-AUTH-UPDATE-01', progressTitle: 'Generating New Profile Signature', - progressInfo: `Trying to Update Push Chat Keys to ${pgpEncryptionVersion} version. Please sign the message to continue.`, + progressInfo: `Trying to Update Push Keys to ${pgpEncryptionVersion} version. Please sign the message to continue.`, level: 'INFO', }; }, @@ -117,7 +117,7 @@ const PROGRESSHOOK: Record< return { progressId: 'PUSH-AUTH-UPDATE-02', progressTitle: 'Generating New Encrypted Profile', - progressInfo: `Encrypting Push Chat Keys with ${pgpEncryptionVersion} version. Please sign the message to continue.`, + progressInfo: `Encrypting Push Keys with ${pgpEncryptionVersion} version. Please sign the message to continue.`, level: 'INFO', }; }, @@ -125,12 +125,12 @@ const PROGRESSHOOK: Record< progressId: 'PUSH-AUTH-UPDATE-03', progressTitle: 'Syncing Updated Profile', progressInfo: - 'Please sign the message to continue. Steady lads, chat is almost ready!', + 'Please sign the message to continue. Updated keys are almost ready!', level: 'INFO', }, 'PUSH-AUTH-UPDATE-04': { progressId: 'PUSH-AUTH-UPDATE-04', - progressTitle: 'Update Completed, Welcome to Push Chat', + progressTitle: 'Update Completed, Welcome to Push Protocol', progressInfo: '', level: 'SUCCESS', }, @@ -143,7 +143,7 @@ const PROGRESSHOOK: Record< 'PUSH-AUTH-UPDATE-06': { progressId: 'PUSH-AUTH-UPDATE-06', progressTitle: 'Generating New Profile Signature', - progressInfo: `Encrypting Push Chat Keys with new creds. Please sign the message to continue.`, + progressInfo: `Encrypting Push Keys with new creds. Please sign the message to continue.`, level: 'INFO', }, /** @@ -172,7 +172,7 @@ const PROGRESSHOOK: Record< }, 'PUSH-PROFILE-UPDATE-02': { progressId: 'PUSH-PROFILE-UPDATE-02', - progressTitle: 'Profile Update Completed, Welcome to Push Chat', + progressTitle: 'Profile Update Completed, Welcome to Push Protocol', progressInfo: '', level: 'SUCCESS', }, diff --git a/packages/restapi/tests/lib/space/space.test.ts b/packages/restapi/tests/lib/space/space.test.ts index f535e758b..116002bb4 100644 --- a/packages/restapi/tests/lib/space/space.test.ts +++ b/packages/restapi/tests/lib/space/space.test.ts @@ -54,6 +54,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); @@ -69,6 +72,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); @@ -95,6 +101,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); @@ -123,6 +132,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); @@ -150,6 +162,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); @@ -182,6 +197,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); @@ -216,6 +234,9 @@ describe('PushAPI.space', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }); diff --git a/packages/restapi/tests/lib/stream/space.test.ts b/packages/restapi/tests/lib/stream/space.test.ts index ae63c27a7..cc5315e1d 100644 --- a/packages/restapi/tests/lib/stream/space.test.ts +++ b/packages/restapi/tests/lib/stream/space.test.ts @@ -20,14 +20,14 @@ describe('PushStream.initialize functionality', () => { const signer = new ethers.Wallet(WALLET.privateKey, provider); const userAlice = await PushAPI.initialize(signer, { - env: CONSTANTS.ENV.LOCAL, + env: CONSTANTS.ENV.DEV, }); const WALLET2 = ethers.Wallet.createRandom(); const signer2 = new ethers.Wallet(WALLET2.privateKey); const account2 = `eip155:${signer2.address}`; const userBob = await PushAPI.initialize(signer2, { - env: CONSTANTS.ENV.LOCAL, + env: CONSTANTS.ENV.DEV, }); const userAliceStream = await userAlice.initStream( @@ -59,6 +59,9 @@ describe('PushStream.initialize functionality', () => { participants: { listeners: [], speakers: [] }, schedule: { start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000), + end: new Date( + new Date().getTime() + 24 * 60 * 60 * 1000 + 60 * 60 * 1000 + ), }, private: false, }; diff --git a/packages/restapi/tests/lib/video/sendVideoNotification.test.ts b/packages/restapi/tests/lib/video/sendVideoNotification.test.ts index bbc8c73e3..9f73e43a8 100644 --- a/packages/restapi/tests/lib/video/sendVideoNotification.test.ts +++ b/packages/restapi/tests/lib/video/sendVideoNotification.test.ts @@ -35,7 +35,7 @@ enum ENV { LOCAL = 'local', } -const env = ENV.LOCAL; +const env = ENV.DEV; // Test suite for sendNotification functionality for video calls describe('sendNotification functionality for video calls', () => {