test(forms): added missing selfOnly tests (#12317)

This commit is contained in:
Florian Kinder
2016-10-18 07:51:13 +02:00
committed by Igor Minar
parent a5419608e0
commit 15fc5dd7ee
3 changed files with 48 additions and 1 deletions

View File

@ -429,6 +429,12 @@ export function main() {
expect(c.value).toBe('initial value');
});
it('should not set the parent when explicitly specified', () => {
const g = new FormGroup({'one': c});
c.patchValue('newValue', {onlySelf: true});
expect(g.value).toEqual({'one': 'initial value'});
});
it('should reset to a specific value if passed with boxed value', () => {
c.setValue('new value');
expect(c.value).toBe('new value');