如何在Jasmine单元测试中的ReactiveForm中设置AbstractControl的值?
我的表单:
npm config set script-shell pwsh --userconfig ./.npmrc
我在茉莉花单元测试中的模拟:
this.formChangePassword = this.formBuilder.group({
username: ['', [Validators.required]],
oldpassword: ['', [Validators.required]],
passwords: this.formBuilder.group({
newpassword: ['', [Validators.required]],
confirmpassword: ['', [Validators.required]]
}, {validator: this.passwordConfirming})
});
我正在寻找在component.formChangePassword.controls.username.setValue('foo'); <= is OK
component.formChangePassword.controls.passwords.controls.newpassword.setValue('newpwd'); <= is KO
newpwd
中写newpassword
AbstractControl