Skip to content

Commit 9088e57

Browse files
committed
test(compiler): add regression coverage for signal array generic parsing
closes #1489
1 parent 1fc0c57 commit 9088e57

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

test/src/app/compiler/angular/deps/helpers/component-helper.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,28 @@ describe('ComponentHelper', () => {
301301
});
302302
});
303303

304+
it('should parse input signal with array generic type and array default value (issue #1489)', () => {
305+
const defaultValue = 'input<string[]>([])';
306+
const result = componentHelper['getSignalConfig']('input', defaultValue);
307+
308+
expect(result).to.deep.equal({
309+
required: false,
310+
type: 'string[]',
311+
defaultValue: '[]'
312+
});
313+
});
314+
315+
it('should parse input signal with array generic type and no default value (issue #1489)', () => {
316+
const defaultValue = 'input<TestInput[]>()';
317+
const result = componentHelper['getSignalConfig']('input', defaultValue);
318+
319+
expect(result).to.deep.equal({
320+
required: false,
321+
type: 'TestInput[]',
322+
defaultValue: undefined
323+
});
324+
});
325+
304326
it('should parse output signal configuration', () => {
305327
const defaultValue = 'output<string>()';
306328
const result = componentHelper['getSignalConfig']('output', defaultValue);

0 commit comments

Comments
 (0)