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: CommonModule is missing #3635

Closed
satanTime opened this issue Sep 19, 2022 · 1 comment · Fixed by #3688
Closed

Bug: CommonModule is missing #3635

satanTime opened this issue Sep 19, 2022 · 1 comment · Fixed by #3688
Assignees
Labels
bug Something isn't working released v14.2.3

Comments

@satanTime
Copy link
Member

import { CommonModule } from "@angular/common";
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { TestBed } from "@angular/core/testing";
import { ActivatedRoute, RouterModule } from "@angular/router";
import { MockBuilder, MockProvider } from "ng-mocks";

@Component({
  standalone: true,
  imports: [CommonModule, RouterModule],
  template: ` <a [routerLink]="['link']">Link</a> `,
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class MyComponent {
  constructor(public activatedRoute: ActivatedRoute) {}
}

describe("my sandbox", () => {
  // beforeEach(() =>
  //   MockBuilder(MyComponent).provide(MockProvider(ActivatedRoute))
  // );

  beforeEach(() => MockBuilder(MyComponent, ActivatedRoute));

  it("should create", () => {
    const fixture = TestBed.createComponent(MyComponent);
    const component = fixture.componentInstance;
    expect(component).toBeTruthy();
  });
});
@satanTime satanTime added the bug Something isn't working label Sep 19, 2022
@satanTime satanTime self-assigned this Sep 19, 2022
satanTime added a commit that referenced this issue Sep 24, 2022
fix(MockBuilder): better detection of provided dependencies #3635
@satanTime
Copy link
Member Author

v14.2.3 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.

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

Successfully merging a pull request may close this issue.

1 participant