fix(forms): improve error message for invalid value accessors (#22731)
Signed-off-by: Dirk Luijk <mail@dirkluijk.nl> PR Close #22731
This commit is contained in:

committed by
Alex Rickabaugh

parent
ae76eeca6a
commit
dd615950d5
@ -55,6 +55,12 @@ function asyncValidator(expected: any, timeout = 0) {
|
||||
it('should throw when given an empty array',
|
||||
() => { expect(() => selectValueAccessor(dir, [])).toThrowError(); });
|
||||
|
||||
it('should throw when accessor is not provided as array', () => {
|
||||
expect(() => selectValueAccessor(dir, {} as any[]))
|
||||
.toThrowError(
|
||||
`Value accessor was not provided as an array for form control with unspecified name attribute`);
|
||||
});
|
||||
|
||||
it('should return the default value accessor when no other provided',
|
||||
() => { expect(selectValueAccessor(dir, [defaultAccessor])).toEqual(defaultAccessor); });
|
||||
|
||||
|
Reference in New Issue
Block a user