Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Angular 19 - Standalone by default #10632

Open
PieterjanDeClippel opened this issue Dec 4, 2024 · 1 comment
Open

Bug: Angular 19 - Standalone by default #10632

PieterjanDeClippel opened this issue Dec 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@PieterjanDeClippel
Copy link

Description of the bug

MockComponent doesn't take into account that standalone = true by default from angular 19

An example of the bug

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BsGridComponent } from './grid.component';
import { MockComponent } from 'ng-mocks';
import { BsContainerComponent } from '@mintplayer/ng-bootstrap/container';

describe('BsGridComponent', () => {
  let component: BsGridComponent;
  let fixture: ComponentFixture<BsGridComponent>;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [BsGridComponent],
      imports: [
        MockComponent(BsContainerComponent)
      ]
    }).compileComponents();

    fixture = TestBed.createComponent(BsGridComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});

The following works

@Component({
  selector: 'bs-container',
  templateUrl: './container.component.html',
  styleUrls: ['./container.component.scss'],
  standalone: true
})
export class BsContainerComponent {}

The following fails

@Component({
  selector: 'bs-container',
  templateUrl: './container.component.html',
  styleUrls: ['./container.component.scss'],
  //standalone: true
})
export class BsContainerComponent {}

Link:

Expected vs actual behavior

@PieterjanDeClippel PieterjanDeClippel added the bug Something isn't working label Dec 4, 2024
@GipHub123
Copy link

This is a duplicate with #10503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants