Skip to content

Commit 136ffbc

Browse files
committed
refactor(forms): Add a test that uses ControlConfig with a non-static validator. (#49693)
Previously, this PR cleaned up a bug introduced by #48679. However, since that PR needed to be rolled back, this PR now just checks in the test, to prevent that issue from re-occurring in the future. PR Close #49693
1 parent 3b863dd commit 136ffbc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/forms/test/typed_integration_spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,15 @@ describe('Typed Class', () => {
11051105
let t1 = c3.controls;
11061106
t1 = null as unknown as ControlsType;
11071107
}
1108+
1109+
const c4 = fb.group({foo: [[1, 2, 3], Validators.maxLength(4)]});
1110+
{
1111+
type ControlsType = {foo: FormControl<number[]|null>};
1112+
let t: ControlsType = c4.controls;
1113+
let t1 = c4.controls;
1114+
t1 = null as unknown as ControlsType;
1115+
}
1116+
expect(c4.controls.foo.value).toEqual([1, 2, 3]);
11081117
});
11091118

11101119
it('from objects with ControlConfigs and validator lists', () => {

0 commit comments

Comments
 (0)