Skip to content

Commit

Permalink
Merge branch 'dev' into virgile/move-acc-changes-to-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Gira committed Sep 8, 2022
2 parents efde89d + 86cef9c commit ade9404
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 3,021 deletions.
2,614 changes: 0 additions & 2,614 deletions .betterer.results

This file was deleted.

24 changes: 0 additions & 24 deletions .betterer.ts

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/betterer.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
CHANGELOG.md
node_modules
npm-debug.log
yarn-error.log
.betterer.cache
yarn-error.log
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
yarn betterer
npx --no-install lint-staged
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@emotion/react": "11.9.0",
"@wireapp/antiscroll-2": "1.3.1",
"@wireapp/avs": "8.2.8",
"@wireapp/core": "30.2.0",
"@wireapp/core": "30.4.0",
"@wireapp/react-ui-kit": "8.13.7",
"@wireapp/store-engine-dexie": "1.6.10",
"@wireapp/store-engine-sqleet": "1.7.14",
Expand Down Expand Up @@ -62,8 +62,6 @@
"@babel/preset-env": "7.18.10",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@betterer/cli": "^5.4.0",
"@betterer/typescript": "5.4.0",
"@faker-js/faker": "6.3.1",
"@formatjs/cli": "4.8.4",
"@koush/wrtc": "0.5.3",
Expand Down Expand Up @@ -239,9 +237,7 @@
"translate:extract": "i18next-scanner 'src/{page,script}/**/*.{js,html,htm}'",
"translate:merge": "formatjs extract --format './bin/translations_extract_formatter.js' --out-file './src/i18n/en-US.json' './src/script/strings.ts'",
"translate:upload": "yarn translate:merge && ts-node ./bin/translations_upload.ts",
"translate:download": "ts-node ./bin/translations_download.ts",
"betterer": "betterer precommit",
"betterer:conflict": "betterer merge"
"translate:download": "ts-node ./bin/translations_download.ts"
},
"version": "0.19.0"
}
62 changes: 42 additions & 20 deletions src/script/calling/CallingRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {TestFactory} from 'test/helper/TestFactory';
import {MediaDevicesHandler} from '../media/MediaDevicesHandler';
import {CALL_MESSAGE_TYPE} from './enum/CallMessageType';
import {CALL} from '../event/Client';
import {UserRepository} from '../user/UserRepository';
import {LEAVE_CALL_REASON} from './enum/LeaveCallReason';

const createSelfParticipant = () => {
Expand Down Expand Up @@ -128,19 +129,40 @@ describe('CallingRepository', () => {
it('only exposes the current active call', () => {
const selfParticipant = createSelfParticipant();
const userId = {domain: '', id: ''};
const incomingCall = new Call(userId, createConversationId(), undefined, selfParticipant, CALL_TYPE.NORMAL, {
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler);
const incomingCall = new Call(
userId,
createConversationId(),
CONV_TYPE.CONFERENCE,
selfParticipant,
CALL_TYPE.NORMAL,
{
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler,
);
incomingCall.state(CALL_STATE.INCOMING);

const activeCall = new Call(userId, createConversationId(), undefined, selfParticipant, CALL_TYPE.NORMAL, {
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler);
const activeCall = new Call(
userId,
createConversationId(),
CONV_TYPE.CONFERENCE,
selfParticipant,
CALL_TYPE.NORMAL,
{
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler,
);
activeCall.state(CALL_STATE.MEDIA_ESTAB);

const declinedCall = new Call(userId, createConversationId(), undefined, selfParticipant, CALL_TYPE.NORMAL, {
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler);
const declinedCall = new Call(
userId,
createConversationId(),
CONV_TYPE.CONFERENCE,
selfParticipant,
CALL_TYPE.NORMAL,
{
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler,
);
declinedCall.state(CALL_STATE.INCOMING);
declinedCall.reason(REASON.STILL_ONGOING);

Expand All @@ -154,7 +176,7 @@ describe('CallingRepository', () => {
it('returns cached mediastream for self user if set', () => {
const selfParticipant = createSelfParticipant();
const userId = {domain: '', id: ''};
const call = new Call(userId, createConversationId(), undefined, selfParticipant, CALL_TYPE.NORMAL, {
const call = new Call(userId, createConversationId(), CONV_TYPE.CONFERENCE, selfParticipant, CALL_TYPE.NORMAL, {
currentAvailableDeviceId: mediaDevices,
} as MediaDevicesHandler);
const source = new RTCAudioSource();
Expand All @@ -179,7 +201,7 @@ describe('CallingRepository', () => {
const call = new Call(
{domain: '', id: ''},
createConversationId(),
undefined,
CONV_TYPE.CONFERENCE,
selfParticipant,
CALL_TYPE.NORMAL,
{
Expand Down Expand Up @@ -243,7 +265,7 @@ describe('CallingRepository ISO', () => {
return avsCall && avsCall.destroy(avsUser);
});

it('creates and stores a new call when an incoming call arrives', async done => {
it('creates and stores a new call when an incoming call arrives', async () => {
const selfUser = new User(createRandomUuid());
selfUser.isMe = true;

Expand Down Expand Up @@ -366,7 +388,7 @@ describe('CallingRepository ISO', () => {
callingRepo.onIncomingCall(call => {
expect(callingRepo['callState'].calls().length).toBe(1);

done();
return Promise.resolve();
});
await callingRepo.onCallEvent(event, '');
});
Expand All @@ -382,7 +404,7 @@ describe.skip('E2E audio call', () => {
const client = new CallingRepository(
messageRepository,
eventRepository,
undefined,
{} as UserRepository,
serverTimeHandler as any,
{} as any,
{} as any,
Expand Down Expand Up @@ -430,7 +452,7 @@ describe.skip('E2E audio call', () => {
*/
client
.getStats(call.conversationId)
.then(extractAudioStats)
?.then(extractAudioStats)
.then(audioStats => {
if (audioStats.length > 0) {
onCallConnected();
Expand Down Expand Up @@ -460,7 +482,7 @@ describe.skip('E2E audio call', () => {
expect(client.onCallEvent).toHaveBeenCalledTimes(1);
client
.getStats(conversationId)
.then(extractAudioStats)
?.then(extractAudioStats)
.then(audioStats => {
expect(audioStats.length).toBeGreaterThan(0);
audioStats.forEach(stats => {
Expand All @@ -483,7 +505,7 @@ describe.skip('E2E audio call', () => {
expect(client['incomingCallCallback']).toHaveBeenCalled();
client
.getStats(conversationId)
.then(extractAudioStats)
?.then(extractAudioStats)
.then(audioStats => {
expect(audioStats.length).toBeGreaterThan(0);
audioStats.forEach(stats => {
Expand Down Expand Up @@ -516,12 +538,12 @@ function createAutoAnsweringWuser(wCall: Wcall, remoteCallingRepository: Calling
const selfUserId = createRandomUuid();
const selfClientId = createRandomUuid();
const sendMsg = (
context: any,
_context: number,
conversationId: string,
userId: string,
clientId: string,
destinationUserId: string,
destinationClientId: string,
targets: string | null,
_unused: string | null,
payload: string,
) => {
const event = {
Expand Down
Loading

0 comments on commit ade9404

Please sign in to comment.