[CST-4319] Corrected test assertion

This commit is contained in:
Alessandro Martelli
2021-06-24 16:57:41 +02:00
parent 3795ab0495
commit 8be77017e9

View File

@@ -156,13 +156,15 @@ describe('ItemSelectComponent', () => {
beforeEach(() => {
comp.featureId = FeatureID.CanManageMappings;
spyOn(authorizationDataService, 'isAuthorized').and.returnValue(of(false));
fixture.detectChanges();
});
it('should disable the checkbox', () => {
const checkbox = fixture.debugElement.query(By.css('input.item-checkbox')).nativeElement;
expect(authorizationDataService.isAuthorized).toHaveBeenCalled();
expect(checkbox.checked).toBeFalsy();
});
it('should disable the checkbox', waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
const checkbox = fixture.debugElement.query(By.css('input.item-checkbox')).nativeElement;
expect(authorizationDataService.isAuthorized).toHaveBeenCalled();
expect(checkbox.disabled).toBeTrue();
});
}));
});
});