import { TestBed } from '@angular/core/testing';
-import { App } from './app';
+import { AppComponent } from './app.component';
describe('App', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [App],
+ imports: [AppComponent],
}).compileComponents();
});
it('should create the app', () => {
- const fixture = TestBed.createComponent(App);
+ const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it('should render title', () => {
- const fixture = TestBed.createComponent(App);
+ const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, chatroom-frontend');
@Component({
selector: 'app-root',
imports: [RouterOutlet],
- templateUrl: './app.html',
- styleUrl: './app.less'
+ templateUrl: './app.component.html',
+ styleUrl: './app.component.less'
})
-export class App {
+export class AppComponent {
protected readonly title = signal('chatroom-frontend');
}
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
-import { App } from './app/app';
+import { AppComponent } from './app/app.component';
-bootstrapApplication(App, appConfig)
+bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));