dataTeamService = jasmine.createSpyObj('DataTeamService',['setDataGroup'],{ selectValGroup: of({ id : 1, accessData : false }) }); it('shoud remove valData when accessData is false',()=>{ fixture.detectChanges(); expect(component.tabs). toEqual([{url: 'view', label : 'Value Management'}]) }) it('shoud add valData when accessData is true',()=>{ fixture.detectChanges(); expect(component.tabs). toEqual([{url: 'view', label : 'Value Management'}],[{url: 'valData', label : 'Value Contact'}]) }) First test is getting passed as accessData value is false But second test is getting failed as it accessData is false still..need to update that for the second test , I tried copy entire mock and paste to second test case it doesn't pass I tried copy entire mock data nd paste inside second test, and selectValGroup is throw error as its readable only not able to update Continue reading...