@@ -180,6 +180,7 @@ describe('OrcidSyncSettingsComponent test suite', () => {
180180 scheduler = getTestScheduler ( ) ;
181181 fixture = TestBed . createComponent ( OrcidSyncSettingsComponent ) ;
182182 comp = fixture . componentInstance ;
183+ researcherProfileService . findByRelatedItem . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockResearcherProfile ) ) ;
183184 comp . item = mockItemLinkedToOrcid ;
184185 fixture . detectChanges ( ) ;
185186 } ) ) ;
@@ -216,7 +217,6 @@ describe('OrcidSyncSettingsComponent test suite', () => {
216217 } ) ;
217218
218219 it ( 'should call updateByOrcidOperations properly' , ( ) => {
219- researcherProfileService . findByRelatedItem . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockResearcherProfile ) ) ;
220220 researcherProfileService . patch . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockResearcherProfile ) ) ;
221221 const expectedOps : Operation [ ] = [
222222 {
@@ -245,7 +245,6 @@ describe('OrcidSyncSettingsComponent test suite', () => {
245245 } ) ;
246246
247247 it ( 'should show notification on success' , ( ) => {
248- researcherProfileService . findByRelatedItem . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockResearcherProfile ) ) ;
249248 researcherProfileService . patch . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockResearcherProfile ) ) ;
250249
251250 scheduler . schedule ( ( ) => comp . onSubmit ( formGroup ) ) ;
@@ -257,6 +256,8 @@ describe('OrcidSyncSettingsComponent test suite', () => {
257256
258257 it ( 'should show notification on error' , ( ) => {
259258 researcherProfileService . findByRelatedItem . and . returnValue ( createFailedRemoteDataObject$ ( ) ) ;
259+ comp . item = mockItemLinkedToOrcid ;
260+ fixture . detectChanges ( ) ;
260261
261262 scheduler . schedule ( ( ) => comp . onSubmit ( formGroup ) ) ;
262263 scheduler . flush ( ) ;
@@ -266,7 +267,6 @@ describe('OrcidSyncSettingsComponent test suite', () => {
266267 } ) ;
267268
268269 it ( 'should show notification on error' , ( ) => {
269- researcherProfileService . findByRelatedItem . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockResearcherProfile ) ) ;
270270 researcherProfileService . patch . and . returnValue ( createFailedRemoteDataObject$ ( ) ) ;
271271
272272 scheduler . schedule ( ( ) => comp . onSubmit ( formGroup ) ) ;
0 commit comments