-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Closed as not planned
Closed as not planned
Copy link
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimearea: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBed
Milestone
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
While debugging some tests on adev I stumbled upon this :
import { Component, provideZonelessChangeDetection, viewChild,} from '@angular/core';
import { TestBed } from '@angular/core/testing';
@Component({
template: `<button #resizer></button>`,
})
export class Tutorial {
readonly resizer = viewChild('resizer');
}
describe('Tutorial', () => {
it('should create', () => {
TestBed.configureTestingModule({
providers: [provideZonelessChangeDetection()],
});
// Comment to pass the test
TestBed.overrideComponent(Tutorial, {});
const fixture = TestBed.createComponent(Tutorial);
fixture.detectChanges();
expect(fixture.componentInstance.resizer()).toBeDefined();
});
});
AOT + overriding a component breaks signal view queries.
Edit: It only affects signal view queries, the decorator ones are fine.
Mikastark
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimearea: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBed