[DSC-112] unit testing

This commit is contained in:
Alba Aliu
2021-09-24 17:07:38 +02:00
parent cbab3484e7
commit b22d8358fb
2 changed files with 62 additions and 0 deletions

View File

@@ -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)
});
})
})
});