Skip to content

Commit fbbbc18

Browse files
committed
refactor: code
1 parent 35f8b55 commit fbbbc18

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { AuthorizationDataService } from '../../../core/data/feature-authorizati
1616
import { IdentifierDataService } from '../../../core/data/identifier-data.service';
1717
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
1818
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
19+
import { OrcidAuthService } from '../../../core/orcid/orcid-auth.service';
1920

2021
let mockIdentifierDataService: IdentifierDataService;
2122
let mockConfigurationDataService: ConfigurationDataService;
@@ -57,12 +58,18 @@ describe('ItemStatusComponent', () => {
5758
};
5859

5960
let authorizationService: AuthorizationDataService;
61+
let orcidAuthService: any;
6062

6163
beforeEach(waitForAsync(() => {
6264
authorizationService = jasmine.createSpyObj('authorizationService', {
6365
isAuthorized: observableOf(true)
6466
});
6567

68+
orcidAuthService = jasmine.createSpyObj('OrcidAuthService', {
69+
onlyAdminCanDisconnectProfileFromOrcid: observableOf ( true ),
70+
isLinkedToOrcid: true
71+
});
72+
6673
TestBed.configureTestingModule({
6774
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
6875
declarations: [ItemStatusComponent],
@@ -71,7 +78,8 @@ describe('ItemStatusComponent', () => {
7178
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
7279
{ provide: AuthorizationDataService, useValue: authorizationService },
7380
{ provide: IdentifierDataService, useValue: mockIdentifierDataService },
74-
{ provide: ConfigurationDataService, useValue: mockConfigurationDataService }
81+
{ provide: ConfigurationDataService, useValue: mockConfigurationDataService },
82+
{ provide: OrcidAuthService, useValue: orcidAuthService },
7583
], schemas: [CUSTOM_ELEMENTS_SCHEMA]
7684
}).compileComponents();
7785
}));

0 commit comments

Comments
 (0)