Guest User

Untitled

a guest
Oct 22nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <input
  2. id="radio-{{geo.id}}"
  3. name="radio-geos"
  4. type="radio"
  5. [value]="geo.value"
  6. [(ngModel)]="selectedGeo">
  7.  
  8. it('should select the US Home Region', (done) => {
  9. // Arrange
  10. const component = TestBed.createComponent(regionComponent);
  11.  
  12. // Act
  13. component.detectChanges();
  14. const usGeoRadioButton = component.debugElement.query(By.css('#radio-0'));
  15.  
  16. usGeoRadioButton.triggerEventHandler('click', null);
  17. component.detectChanges();
  18. const selectedGeo = component.componentInstance.selectedGeo;
  19.  
  20. // Assert
  21. component.whenStable().then(() => {
  22. expect(selectedGeo).toBe('US');
  23. done();
  24. });
  25. });
Add Comment
Please, Sign In to add comment