Skip to content

The test AppComponent "should render title" is failing #49

Description

@RichtersFinger

My institution is starting to work on a customization package for our Primo instance.
Since we are considering unit tests as well, I ran the existing setup.
However, the test "should render title" in src/app/app.component.spec.ts is currently failing:

Expected undefined to contain 'custom-module app is running!'.

An easy fix would be to simply update the src/app/app.component.html with something like

<div class="content">
  <span>custom-module app is running!</span>
</div>

to add the expected element or update the test itself like

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('p')?.textContent).toContain(app.title);
  });

Would you like me to create a pull request for one of these options?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions