1
0
mirror of https://github.com/pavlobu/deskreen.git synced 2025-05-18 08:20:10 -07:00
deskreen/app/features/SharingSessionsService/SharingSession.spec.ts
2020-09-28 15:28:37 +03:00

35 lines
938 B
TypeScript

import SharingSessionService from '.';
import SharingType from './SharingType';
jest.useFakeTimers();
describe('SharingSession unit tests', () => {
let sharingSession: SharingSessionService;
beforeEach(() => {
sharingSession = new SharingSessionService();
});
afterEach(() => {
jest.clearAllMocks();
});
describe('when new SahringSession() is called', () => {
it('should create sharing session with id', () => {
expect(sharingSession.id).toBeTruthy();
});
it('should crete sharing session with deviceID equal to "" ', () => {
expect(sharingSession.deviceID).toBe('');
});
it('should create sharing session with sharingType equal to NOT_SET', () => {
expect(sharingSession.sharingType).toBe(SharingType.NOT_SET);
});
it('should create sharing session with sharingStream set to null', () => {
expect(sharingSession.sharingStream).toBe(null);
});
});
});