The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/apps-engine/tests/server/accessors/VideoConferenceRead.spec.ts

34 lines
1.2 KiB

import { AsyncTest, Expect, SetupFixture } from 'alsatian';
import type { VideoConference } from '../../../src/definition/videoConferences';
import { VideoConferenceRead } from '../../../src/server/accessors';
import type { VideoConferenceBridge } from '../../../src/server/bridges';
import { TestData } from '../../test-data/utilities';
export class VideoConferenceReadAccessorTestFixture {
private videoConference: VideoConference;
private mockVideoConfBridge: VideoConferenceBridge;
@SetupFixture
public setupFixture() {
this.videoConference = TestData.getVideoConference();
const call = this.videoConference;
this.mockVideoConfBridge = {
doGetById(id, appId): Promise<VideoConference> {
return Promise.resolve(call);
},
} as VideoConferenceBridge;
}
@AsyncTest()
public async expectDataFromVideoConferenceRead() {
Expect(() => new VideoConferenceRead(this.mockVideoConfBridge, 'testing-app')).not.toThrow();
const read = new VideoConferenceRead(this.mockVideoConfBridge, 'testing-app');
Expect(await read.getById('fake')).toBeDefined();
Expect(await read.getById('fake')).toBe(this.videoConference);
}
}