import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';<% if(!minimal) { %>
import { NxWelcomeComponent } from './nx-welcome.component';<% } %><% if(routing) { %>
import { RouterTestingModule } from '@angular/router/testing';<% } %>

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [<% if(routing) { %>RouterTestingModule<% } %>],
      declarations: [AppComponent<% if(!minimal) { %>, NxWelcomeComponent<% } %>]
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain('Welcome <%= appName %>');
  });<% if(!minimal) { %>

  it(`should have as title '<%= appName %>'`, () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app.title).toEqual('<%= appName %>');
  });<% } %>
});
