diff --git a/tests/app/core/models/session-model.spec.ts b/tests/app/core/models/session-model.spec.ts index fe9f3bdaa..b15d73d4b 100644 --- a/tests/app/core/models/session-model.spec.ts +++ b/tests/app/core/models/session-model.spec.ts @@ -5,7 +5,7 @@ import { OPENED_PHASE_REPO_UNDEFINED, SessionData, SESSION_DATA_UNAVAILABLE, - SESSION_DATA_MISSING_OPENPHASES_KEY + SESSION_DATA_MISSING_OPENPHASES_KEY, } from '../../../../src/app/core/models/session.model'; import { Phase } from '../../../../src/app/core/models/phase.model'; import { of } from 'rxjs'; @@ -29,8 +29,8 @@ describe('Session Model', () => { of(undefined) .pipe(assertSessionDataIntegrity()) .subscribe({ - error: (err) => - expect(err).toEqual(new Error(SESSION_DATA_UNAVAILABLE)), + next: () => fail(), + error: (err) => expect(err).toEqual(new Error(SESSION_DATA_UNAVAILABLE)), }); }); @@ -47,6 +47,7 @@ describe('Session Model', () => { of({ openPhases: [] }) .pipe(assertSessionDataIntegrity()) .subscribe({ + next: () => fail(), error: (err) => expect(err).toEqual(new Error(NO_ACCESSIBLE_PHASES)), }); }); @@ -61,29 +62,38 @@ describe('Session Model', () => { }); it('should throw error on session data with undefined repo for open phase', () => { - const modifiedSessionData: SessionData = { ...validSessionData, openPhases: [Phase.phaseBugReporting] }; + const modifiedSessionData: SessionData = { + ...validSessionData, + openPhases: [Phase.phaseBugReporting], + }; of({ ...modifiedSessionData, phaseBugReporting: undefined }) .pipe(assertSessionDataIntegrity()) .subscribe({ next: () => fail(), - error: (err) => expect(err).toEqual(new Error(OPENED_PHASE_REPO_UNDEFINED)), + error: (err) => + expect(err).toEqual(new Error(OPENED_PHASE_REPO_UNDEFINED)), }); of({ ...modifiedSessionData, phaseBugReporting: null }) .pipe(assertSessionDataIntegrity()) .subscribe({ next: () => fail(), - error: (err) => expect(err).toEqual(new Error(OPENED_PHASE_REPO_UNDEFINED)), + error: (err) => + expect(err).toEqual(new Error(OPENED_PHASE_REPO_UNDEFINED)), }); of({ ...modifiedSessionData, phaseBugReporting: '' }) .pipe(assertSessionDataIntegrity()) .subscribe({ next: () => fail(), - error: (err) => expect(err).toEqual(new Error(OPENED_PHASE_REPO_UNDEFINED)), + error: (err) => + expect(err).toEqual(new Error(OPENED_PHASE_REPO_UNDEFINED)), }); }); it('should not throw error if session data contains repo information of unopened phases', () => { - const modifiedSessionData: SessionData = { ...validSessionData, openPhases: [Phase.phaseBugReporting] }; + const modifiedSessionData: SessionData = { + ...validSessionData, + openPhases: [Phase.phaseBugReporting], + }; of({ ...modifiedSessionData }) .pipe(assertSessionDataIntegrity()) .subscribe({