fix(ivy): add support for optional nullable injection tokens (#27552)
FW-778 #resolve PR Close #27552
This commit is contained in:
@ -262,7 +262,7 @@ describe('Fesm2015ReflectionHost [import helper style]', () => {
|
||||
expect(parameters !.map(parameter => parameter.name)).toEqual([
|
||||
'_viewContainer', '_template', 'injected'
|
||||
]);
|
||||
expect(parameters !.map(parameter => parameter.type !.getText())).toEqual([
|
||||
expect(parameters !.map(parameter => parameter.typeExpression !.getText())).toEqual([
|
||||
'ViewContainerRef', 'TemplateRef', 'String'
|
||||
]);
|
||||
});
|
||||
@ -296,7 +296,7 @@ describe('Fesm2015ReflectionHost [import helper style]', () => {
|
||||
const classNode = getDeclaration(
|
||||
program, '/some_directive.js', 'SomeDirective', ts.isVariableDeclaration);
|
||||
const ctrDecorators = host.getConstructorParameters(classNode) !;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].type !as ts.Identifier;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].typeExpression !as ts.Identifier;
|
||||
|
||||
const expectedDeclarationNode = getDeclaration(
|
||||
program, '/some_directive.js', 'ViewContainerRef', ts.isClassDeclaration);
|
||||
|
@ -841,7 +841,7 @@ describe('Fesm2015ReflectionHost', () => {
|
||||
expect(parameters.map(parameter => parameter.name)).toEqual([
|
||||
'_viewContainer', '_template', 'injected'
|
||||
]);
|
||||
expect(parameters.map(parameter => parameter.type !.getText())).toEqual([
|
||||
expect(parameters.map(parameter => parameter.typeExpression !.getText())).toEqual([
|
||||
'ViewContainerRef', 'TemplateRef', 'undefined'
|
||||
]);
|
||||
});
|
||||
@ -1140,7 +1140,7 @@ describe('Fesm2015ReflectionHost', () => {
|
||||
const classNode =
|
||||
getDeclaration(program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isClassDeclaration);
|
||||
const ctrDecorators = host.getConstructorParameters(classNode) !;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].type !as ts.Identifier;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].typeExpression !as ts.Identifier;
|
||||
|
||||
const expectedDeclarationNode = getDeclaration(
|
||||
program, SOME_DIRECTIVE_FILE.name, 'ViewContainerRef', ts.isVariableDeclaration);
|
||||
|
@ -277,7 +277,7 @@ describe('Esm5ReflectionHost [import helper style]', () => {
|
||||
expect(parameters !.map(parameter => parameter.name)).toEqual([
|
||||
'_viewContainer', '_template', 'injected'
|
||||
]);
|
||||
expect(parameters !.map(parameter => parameter.type !.getText())).toEqual([
|
||||
expect(parameters !.map(parameter => parameter.typeExpression !.getText())).toEqual([
|
||||
'ViewContainerRef', 'TemplateRef', 'String'
|
||||
]);
|
||||
});
|
||||
@ -311,7 +311,7 @@ describe('Esm5ReflectionHost [import helper style]', () => {
|
||||
const classNode = getDeclaration(
|
||||
program, '/some_directive.js', 'SomeDirective', ts.isVariableDeclaration);
|
||||
const ctrDecorators = host.getConstructorParameters(classNode) !;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].type !as ts.Identifier;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].typeExpression !as ts.Identifier;
|
||||
|
||||
const expectedDeclarationNode = getDeclaration(
|
||||
program, '/some_directive.js', 'ViewContainerRef', ts.isVariableDeclaration);
|
||||
|
@ -824,7 +824,7 @@ describe('Esm5ReflectionHost', () => {
|
||||
expect(parameters !.map(parameter => parameter.name)).toEqual([
|
||||
'_viewContainer', '_template', 'injected'
|
||||
]);
|
||||
expect(parameters !.map(parameter => parameter.type !.getText())).toEqual([
|
||||
expect(parameters !.map(parameter => parameter.typeExpression !.getText())).toEqual([
|
||||
'ViewContainerRef', 'TemplateRef', 'undefined'
|
||||
]);
|
||||
});
|
||||
@ -1079,7 +1079,7 @@ describe('Esm5ReflectionHost', () => {
|
||||
const classNode = getDeclaration(
|
||||
program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isVariableDeclaration);
|
||||
const ctrDecorators = host.getConstructorParameters(classNode) !;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].type !as ts.Identifier;
|
||||
const identifierOfViewContainerRef = ctrDecorators[0].typeExpression !as ts.Identifier;
|
||||
|
||||
const expectedDeclarationNode = getDeclaration(
|
||||
program, SOME_DIRECTIVE_FILE.name, 'ViewContainerRef', ts.isVariableDeclaration);
|
||||
|
Reference in New Issue
Block a user