-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3d1d20
commit 5ae9722
Showing
2 changed files
with
22 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import dotenv from 'dotenv'; | ||
import { Gateway } from '../src/Gateway'; | ||
import { UserIdentifierType } from '../src/types'; | ||
dotenv.config(); | ||
|
||
const DEFAULT_TIMEOUT = 10000; | ||
|
||
let api: Gateway; | ||
|
||
beforeAll(() => { | ||
api = new Gateway({ | ||
apiKey: 'm9Y5ntNcTlwQ2LbRpYr6K_VhxJXuZJ6Q', | ||
token: | ||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm90b2NvbF9pZCI6IjkwNzcwODA2LWFlMGMtNGExNS05MjYzLWU5MWJhYWY1ZDkzZiIsImF1dGgiOnsiaWQiOiJlMjJiOWZkNi05NjgzLTRjZDgtOGZlOS1lZWU0YzFmYTJjZjciLCJ0eXBlIjoiV0FMTEVUIn0sImNyeXB0byI6eyJwdWJsaWNQZW0iOiItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxyXG5NSUlDSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQWc4QU1JSUNDZ0tDQWdFQXpUdTJCWVVSS3VvM2V2MGx0MjUzXHJcblR3SDlGQkhUbU90dlRXYlQraTExSEF5WW5vUGx4UWV3M0cySnAvanNnS0cxbDN4WHBtdEEwVjlkUGxaUHhVS3BcclxueXM2cWNBdkhmaThpdm15dmk1WVhRYnQ4aE1rY3hKb1RzanZ4V092dTF1bjljVlVSU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
"single user", | ||
'single user', | ||
async () => { | ||
const { user } = await api.user.getSingleUser({ | ||
type: UserIdentifierType.GATEWAY_ID, | ||
value: "sid", | ||
value: 'sid', | ||
}); | ||
expect(user?.gatewayId).toEqual("sid"); | ||
expect(user?.gatewayId).toEqual('sid'); | ||
}, | ||
DEFAULT_TIMEOUT | ||
DEFAULT_TIMEOUT, | ||
); | ||
|
||
it( | ||
|
@@ -74,34 +75,19 @@ describe('USER Testing', () => { | |
DEFAULT_TIMEOUT, | ||
); | ||
|
||
// it("update user", async () => { | ||
// const { updateUser } = await api.user.updateUser({ | ||
// displayName: "siddharth9890", | ||
// }); | ||
// expect(updateUser.displayName).toEqual("siddharth9890"); | ||
// }); | ||
|
||
it('update display username', async () => { | ||
const { updateMyDisplayName } = await api.user.updateMyDisplayName('sid'); | ||
expect(updateMyDisplayName).toEqual('sid'); | ||
it('update user', async () => { | ||
const { updateUser } = await api.user.updateUser({ | ||
displayName: 'siddharth9890', | ||
}); | ||
expect(updateUser.displayName).toEqual('siddharth9890'); | ||
}); | ||
|
||
// it("update gateway id", async () => { | ||
// const { updateMyGatewayId } = await api.user.updateMyGatewayId( | ||
// "siddharth9890" | ||
// ); | ||
// expect(updateMyGatewayId.gatewayId).toEqual("siddharth9890"); | ||
// }); | ||
|
||
it('update profile picture', async () => { | ||
const { updateMyProfilePicture } = | ||
await api.user.updateMyProfilePicture('siddharth9890'); | ||
expect(updateMyProfilePicture).toEqual('siddharth9890'); | ||
const { updateMyProfilePicture } = await api.user.updateMyProfilePicture( | ||
'https://www.tryodyssey.xyz/images/campaigns/lifi/odyssey_lifi.png', | ||
); | ||
expect(updateMyProfilePicture).toEqual( | ||
'https://www.tryodyssey.xyz/images/campaigns/lifi/odyssey_lifi.png', | ||
); | ||
}); | ||
|
||
// it("update notification email", async () => { | ||
// const { user } = await api.user.updateNotificationEmail("[email protected]"); | ||
// console.log(user); | ||
// expect(user.email).toEqual("[email protected]"); | ||
// }); | ||
}); |