mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 03:23:07 +00:00
[DSC-112] unit testing
This commit is contained in:
@@ -60,4 +60,30 @@ describe('ValidationSuggestionsComponent', () => {
|
||||
expect(comp.onClickSuggestion).toHaveBeenCalledWith(suggestions[clickedIndex].value);
|
||||
});
|
||||
});
|
||||
describe('can edit input', () => {
|
||||
describe('test input field readonly property when input disable is true', () => {
|
||||
beforeEach(() => {
|
||||
comp.disable = true;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('it should be true', () => {
|
||||
fixture.detectChanges();
|
||||
let input = fixture.debugElement.query(By.css('input'));
|
||||
let el = input.nativeElement;
|
||||
expect(el.readOnly).toBe(true)
|
||||
});
|
||||
})
|
||||
describe('test input field readonly property when input disable is false', () => {
|
||||
beforeEach(() => {
|
||||
comp.disable = false;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('it should be true', () => {
|
||||
fixture.detectChanges();
|
||||
let input = fixture.debugElement.query(By.css('input'));
|
||||
let el = input.nativeElement;
|
||||
expect(el.readOnly).toBe(false)
|
||||
});
|
||||
})
|
||||
})
|
||||
});
|
||||
|
Reference in New Issue
Block a user