build: upgrade jasmine (and related typings) to latest version (#19904)
With these changes, the types are a little stricter now and also not
compatible with Protractor's jasmine-like syntax. So, we have to also
use `@types/jasminewd2` for e2e tests (but not for non-e2e tests).
I also had to "augment" `@types/jasminewd2`, because the latest
typings from [DefinitelyTyped][1] do not reflect the fact that the
`jasminewd2` version (v2.1.0) currently used by Protractor supports
passing a `done` callback to a spec.
[1]: 566e039485/types/jasminewd2/index.d.ts (L9-L15)
Fixes #23952
Closes #24733
PR Close #19904
This commit is contained in:

committed by
Miško Hevery

parent
1e74ea9e60
commit
00c110b055
@ -92,14 +92,14 @@ function asyncValidator(expected: any, timeout = 0) {
|
||||
});
|
||||
|
||||
it('should return custom accessor when provided', () => {
|
||||
const customAccessor = new SpyValueAccessor();
|
||||
const customAccessor: ControlValueAccessor = new SpyValueAccessor() as any;
|
||||
const checkboxAccessor = new CheckboxControlValueAccessor(null !, null !);
|
||||
expect(selectValueAccessor(dir, <any>[defaultAccessor, customAccessor, checkboxAccessor]))
|
||||
.toEqual(customAccessor);
|
||||
});
|
||||
|
||||
it('should return custom accessor when provided with select multiple', () => {
|
||||
const customAccessor = new SpyValueAccessor();
|
||||
const customAccessor: ControlValueAccessor = new SpyValueAccessor() as any;
|
||||
const selectMultipleAccessor = new SelectMultipleControlValueAccessor(null !, null !);
|
||||
expect(selectValueAccessor(
|
||||
dir, <any>[defaultAccessor, customAccessor, selectMultipleAccessor]))
|
||||
|
@ -207,7 +207,7 @@ import {MyInput, MyInputForm} from './value_accessor_integration_spec';
|
||||
fixture.detectChanges();
|
||||
|
||||
emailInput = fixture.debugElement.query(By.css('[formControlName="email"]'));
|
||||
expect(emailInput).toBe(null);
|
||||
expect(emailInput as any).toBe(null); // TODO: Review use of `any` here (#19904)
|
||||
});
|
||||
|
||||
it('should strip array controls that are not found', () => {
|
||||
@ -1393,7 +1393,7 @@ import {MyInput, MyInputForm} from './value_accessor_integration_spec';
|
||||
fixture.componentInstance.form = formGroup;
|
||||
fixture.detectChanges();
|
||||
|
||||
const values: string[] = [];
|
||||
const values: any[] = [];
|
||||
const streams = merge(
|
||||
control.valueChanges, control.statusChanges, formGroup.valueChanges,
|
||||
formGroup.statusChanges);
|
||||
@ -1430,7 +1430,7 @@ import {MyInput, MyInputForm} from './value_accessor_integration_spec';
|
||||
fixture.componentInstance.form = formGroup;
|
||||
fixture.detectChanges();
|
||||
|
||||
const values: string[] = [];
|
||||
const values: (string | {[key: string]: string})[] = [];
|
||||
const streams = merge(
|
||||
control.valueChanges, control.statusChanges, formGroup.valueChanges,
|
||||
formGroup.statusChanges);
|
||||
|
@ -460,7 +460,7 @@ import {NgModelCustomComp, NgModelCustomWrapper} from './value_accessor_integrat
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
|
||||
const values: string[] = [];
|
||||
const values: any[] = [];
|
||||
const form = fixture.debugElement.children[0].injector.get(NgForm);
|
||||
|
||||
const sub = merge(form.valueChanges !, form.statusChanges !)
|
||||
@ -748,7 +748,7 @@ import {NgModelCustomComp, NgModelCustomWrapper} from './value_accessor_integrat
|
||||
|
||||
it('should reset properly', fakeAsync(() => {
|
||||
const fixture = initTest(NgModelForm);
|
||||
fixture.componentInstance.name = 'Nancy';
|
||||
fixture.componentInstance.name = 'Nancy' as string | null;
|
||||
fixture.componentInstance.options = {updateOn: 'submit'};
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
@ -792,7 +792,7 @@ import {NgModelCustomComp, NgModelCustomWrapper} from './value_accessor_integrat
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
|
||||
const values: string[] = [];
|
||||
const values: any[] = [];
|
||||
const form = fixture.debugElement.children[0].injector.get(NgForm);
|
||||
|
||||
const sub = merge(form.valueChanges !, form.statusChanges !)
|
||||
@ -1028,7 +1028,7 @@ import {NgModelCustomComp, NgModelCustomWrapper} from './value_accessor_integrat
|
||||
|
||||
it('should reset the form to empty when reset event is fired', fakeAsync(() => {
|
||||
const fixture = initTest(NgModelForm);
|
||||
fixture.componentInstance.name = 'should be cleared';
|
||||
fixture.componentInstance.name = 'should be cleared' as string | null;
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
|
||||
@ -1654,7 +1654,7 @@ class StandaloneNgModel {
|
||||
})
|
||||
class NgModelForm {
|
||||
// TODO(issue/24571): remove '!'.
|
||||
name !: string;
|
||||
name !: string | null;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
event !: Event;
|
||||
options = {};
|
||||
|
@ -327,7 +327,7 @@ import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util'
|
||||
const fixture = initTest(NgModelSelectWithNullForm);
|
||||
const comp = fixture.componentInstance;
|
||||
comp.cities = [{'name': 'SF'}, {'name': 'NYC'}];
|
||||
comp.selectedCity = null !;
|
||||
comp.selectedCity = null;
|
||||
fixture.detectChanges();
|
||||
|
||||
const select = fixture.debugElement.query(By.css('select'));
|
||||
@ -336,7 +336,7 @@ import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util'
|
||||
dispatchEvent(select.nativeElement, 'change');
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
expect(comp.selectedCity['name']).toEqual('NYC');
|
||||
expect(comp.selectedCity !['name']).toEqual('NYC');
|
||||
|
||||
select.nativeElement.value = '0: null';
|
||||
dispatchEvent(select.nativeElement, 'change');
|
||||
@ -1231,7 +1231,7 @@ class NgModelSelectForm {
|
||||
`
|
||||
})
|
||||
class NgModelSelectWithNullForm {
|
||||
selectedCity: {[k: string]: string} = {};
|
||||
selectedCity: {[k: string]: string}|null = {};
|
||||
cities: any[] = [];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user