diff --git a/packages/core/test/acceptance/control_flow_for_spec.ts b/packages/core/test/acceptance/control_flow_for_spec.ts
index c993d2f4366ed..cc03b21c24894 100644
--- a/packages/core/test/acceptance/control_flow_for_spec.ts
+++ b/packages/core/test/acceptance/control_flow_for_spec.ts
@@ -417,6 +417,37 @@ describe('control flow - for', () => {
expect(fixture.nativeElement.textContent).toBe('Main: Before one1two1one2two2 After Slot: ');
});
+ it('should project an @for with an ng-container root node', () => {
+ @Component({
+ standalone: true,
+ selector: 'test',
+ template: 'Main: Slot: ',
+ })
+ class TestComponent {
+ }
+
+ @Component({
+ standalone: true,
+ imports: [TestComponent],
+ template: `
+ Before @for (item of items; track $index) {
+
+ {{item}}
+ |
+
+ } After
+ `
+ })
+ class App {
+ items = [1, 2, 3];
+ }
+
+ const fixture = TestBed.createComponent(App);
+ fixture.detectChanges();
+
+ expect(fixture.nativeElement.textContent).toBe('Main: Before After Slot: 1|2|3|');
+ });
+
// Right now the template compiler doesn't collect comment nodes.
// This test is to ensure that we don't regress if it happens in the future.
it('should project an @for with single root node and comments into the root node slot', () => {
diff --git a/packages/core/test/acceptance/control_flow_if_spec.ts b/packages/core/test/acceptance/control_flow_if_spec.ts
index 3f63f6d9472ee..969a03807ffb6 100644
--- a/packages/core/test/acceptance/control_flow_if_spec.ts
+++ b/packages/core/test/acceptance/control_flow_if_spec.ts
@@ -317,6 +317,36 @@ describe('control flow - if', () => {
expect(fixture.nativeElement.textContent).toBe('Main: Before onetwo After Slot: ');
});
+ it('should project an @if with an ng-container root node', () => {
+ @Component({
+ standalone: true,
+ selector: 'test',
+ template: 'Main: Slot: ',
+ })
+ class TestComponent {
+ }
+
+ @Component({
+ standalone: true,
+ imports: [TestComponent],
+ template: `
+ Before @if (true) {
+
+ foo
+ bar
+
+ } After
+ `
+ })
+ class App {
+ }
+
+ const fixture = TestBed.createComponent(App);
+ fixture.detectChanges();
+
+ expect(fixture.nativeElement.textContent).toBe('Main: Before After Slot: foobar');
+ });
+
// Right now the template compiler doesn't collect comment nodes.
// This test is to ensure that we don't regress if it happens in the future.
it('should project an @if with a single root node and comments into the root node slot', () => {