validation-suggestions.component.spec.ts (dspace-angular-dspace-7.0) | : | validation-suggestions.component.spec.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
skipping to change at line 63 | skipping to change at line 63 | |||
beforeEach(() => { | beforeEach(() => { | |||
spyOn(comp, 'onClickSuggestion'); | spyOn(comp, 'onClickSuggestion'); | |||
const clickedLink = de.query(By.css('.dropdown-list > div:nth-child(' + (c lickedIndex + 1) + ') a')); | const clickedLink = de.query(By.css('.dropdown-list > div:nth-child(' + (c lickedIndex + 1) + ') a')); | |||
clickedLink.triggerEventHandler('click', {}); | clickedLink.triggerEventHandler('click', {}); | |||
fixture.detectChanges(); | fixture.detectChanges(); | |||
}); | }); | |||
it('should call onClickSuggestion() with the suggestion as a parameter', () => { | it('should call onClickSuggestion() with the suggestion as a parameter', () => { | |||
expect(comp.onClickSuggestion).toHaveBeenCalledWith(suggestions[clickedInd ex].value); | expect(comp.onClickSuggestion).toHaveBeenCalledWith(suggestions[clickedInd ex].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(); | ||||
const input = fixture.debugElement.query(By.css('input')); | ||||
const element = input.nativeElement; | ||||
expect(element.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(); | ||||
const input = fixture.debugElement.query(By.css('input')); | ||||
const element = input.nativeElement; | ||||
expect(element.readOnly).toBe(false); | ||||
}); | ||||
}); | ||||
}); | ||||
}); | }); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 28 lines changed or added |