radio.spec.ts (material2-7.3.3) | : | radio.spec.ts (material2-7.3.4) | ||
---|---|---|---|---|
skipping to change at line 461 | skipping to change at line 461 | |||
expect(groupNgModel.pristine).toBe(true); | expect(groupNgModel.pristine).toBe(true); | |||
expect(groupNgModel.touched).toBe(false); | expect(groupNgModel.touched).toBe(false); | |||
// After a user interaction occurs (such as a click), the control should b ecome dirty and | // After a user interaction occurs (such as a click), the control should b ecome dirty and | |||
// now also be touched. | // now also be touched. | |||
radioLabelElements[2].click(); | radioLabelElements[2].click(); | |||
fixture.detectChanges(); | fixture.detectChanges(); | |||
expect(groupNgModel.valid).toBe(true); | expect(groupNgModel.valid).toBe(true); | |||
expect(groupNgModel.pristine).toBe(false); | expect(groupNgModel.pristine).toBe(false); | |||
expect(groupNgModel.touched).toBe(false); | ||||
// Blur the input element in order to verify that the ng-touched state has | ||||
been set to true. | ||||
// The touched state should be only set to true after the form control has | ||||
been blurred. | ||||
dispatchFakeEvent(innerRadios[2].nativeElement, 'blur'); | ||||
expect(groupNgModel.valid).toBe(true); | ||||
expect(groupNgModel.pristine).toBe(false); | ||||
expect(groupNgModel.touched).toBe(true); | expect(groupNgModel.touched).toBe(true); | |||
}); | }); | |||
it('should write to the radio button based on ngModel', fakeAsync(() => { | it('should write to the radio button based on ngModel', fakeAsync(() => { | |||
testComponent.modelValue = 'chocolate'; | testComponent.modelValue = 'chocolate'; | |||
fixture.detectChanges(); | fixture.detectChanges(); | |||
tick(); | tick(); | |||
fixture.detectChanges(); | fixture.detectChanges(); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added |