fix(ivy): TestBed should use annotation for the last match rather than the first (#28195)
When we look for matching annotations in TestBed, we should always take the last matching annotation. Otherwise, we will return superclass data for subclasses, which would have unintended consequences like directives matching the wrong selectors. PR Close #28195
This commit is contained in:

committed by
Alex Rickabaugh

parent
8a08ff1571
commit
1f7d3b9a57
@ -28,7 +28,7 @@ export function setClassMetadata(
|
||||
propDecorators: {[field: string]: any} | null): void {
|
||||
const clazz = type as TypeWithMetadata;
|
||||
if (decorators !== null) {
|
||||
if (clazz.decorators !== undefined) {
|
||||
if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {
|
||||
clazz.decorators.push(...decorators);
|
||||
} else {
|
||||
clazz.decorators = decorators;
|
||||
|
Reference in New Issue
Block a user