Skip to content

Commit

Permalink
fix: Merge branch 'main' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 committed Jul 11, 2023
2 parents e7f2d30 + f29df59 commit 7b316ec
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"private": true,
"dependencies": {
"@ledgerhq/iframe-provider": "^0.4.2",
"@livepeer/webrtmp-sdk": "^0.2.3",
"@react-native-masked-view/masked-view": "^0.2.7",
"@web3-react/abstract-connector": "^6.0.7",
"axios": "^0.27.2",
Expand Down Expand Up @@ -49,7 +50,8 @@
"ts-mocha": "^10.0.0",
"tslib": "^2.3.0",
"unique-names-generator": "^4.7.1",
"uuid": "^9.0.0"
"uuid": "^9.0.0",
"video-stream-merger": "^4.0.1"
},
"devDependencies": {
"@commitlint/cli": "^17.0.0",
Expand Down
45 changes: 43 additions & 2 deletions packages/restapi/tests/lib/chat/updateGroup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
const _env = Constants.ENV.DEV;
let account: string;
let signer: any;
let account2: string;
let signer2: any;
let groupName: string;
let groupDescription: string;
const groupImage =
Expand All @@ -26,6 +28,10 @@ describe('Update Group', () => {
signer = new ethers.Wallet(WALLET1.privateKey);
account = `eip155:${signer.address}`;

const WALLET2 = ethers.Wallet.createRandom();
signer2 = new ethers.Wallet(WALLET2.privateKey);
account2 = `eip155:${signer2.address}`;

groupName = uniqueNamesGenerator({
dictionaries: [adjectives, colors, animals],
});
Expand Down Expand Up @@ -122,6 +128,40 @@ describe('Update Group', () => {
});
await expectGroup(updatedGroup, true, admins, members, true);
});

it('AutoLeave', async () => {
const admins: string[] = [];
const members = [
account2,
// 'eip155:0xDB0Bb1C25e36a5Ec9d199688bB01eADa4e70225E',
];
// creator - account
const group = await createGroup({
groupName,
groupDescription,
members,
groupImage,
admins,
isPublic: true,
signer, //acount
env: _env,
});

const updatedMembers = [
'eip155:0xDB0Bb1C25e36a5Ec9d199688bB01eADa4e70225E',
];
const updatedGroup = await updateGroup({
groupName,
groupDescription,
members: [...updatedMembers, account],
groupImage,
admins: [account],
chatId: group.chatId,
signer: signer2, //acount2
env: _env,
});
await expectGroup(updatedGroup, true, admins, updatedMembers, false);
});
});

/**
Expand All @@ -142,8 +182,9 @@ const expectGroup = async (
expect(group.members[0].image).to.be.a('string');
expect(group.pendingMembers).to.be.an('array');
expect(group.pendingMembers.length).to.equal(pendingMembers.length);
expect(group.pendingMembers[0].wallet).to.equal(pendingMembers[0]);
expect(group.pendingMembers[1].wallet).to.equal(pendingMembers[1]);
for (let i = 0; i < pendingMembers.length; i++) {
expect(group.pendingMembers[i].wallet).to.equal(pendingMembers[i]);
}
expect(group.groupImage).to.equal(groupImage);
expect(group.groupName).to.equal(groupName);
expect(group.groupDescription).to.equal(groupDescription);
Expand Down
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,13 @@
resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz"
integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==

"@livepeer/webrtmp-sdk@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@livepeer/webrtmp-sdk/-/webrtmp-sdk-0.2.3.tgz#10c5baca5517b8f14ec766df15be467d14e7c8d7"
integrity sha512-tJ2gGhUZfbeXmIkZHxY/WNS0C9SYUhJ/6QlYhot1CJlBuXkuoki9gSGhYhS3G7Vu/HchL1HU/DXWKhrQhlogXg==
dependencies:
events "3.3.0"

"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz"
Expand Down Expand Up @@ -7185,7 +7192,7 @@ eventemitter3@^4.0.0, eventemitter3@^4.0.4:
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz"
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==

events@^3.2.0:
events@3.3.0, events@^3.2.0:
version "3.3.0"
resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz"
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
Expand Down Expand Up @@ -15188,6 +15195,11 @@ vary@~1.1.2:
resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==

video-stream-merger@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/video-stream-merger/-/video-stream-merger-4.0.1.tgz#b0061251bd211121d1256ccf9e2be9477e59d5cb"
integrity sha512-VazYSr8tk6S/zkOq5jpR/ryy1HnGxm5XCw+d2Ejpqy1m6d71oZpyFG82dUkgAo7dg/lk3k4TqvJPtuRUtR8URA==

vlq@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz"
Expand Down

0 comments on commit 7b316ec

Please sign in to comment.