angular/integration/cli-elements-universal/src/app/title.component.spec.ts
Joey Perrott 894c1c5f10 refactor: apply prettier formatting to integration (#54653)
Apply prettier formatting to integration directories

PR Close #54653
2024-04-02 20:42:04 +00:00

27 lines
855 B
TypeScript

import {TestBed} from '@angular/core/testing';
import {TitleComponent} from './title.component';
describe('TitleComponent', () => {
beforeEach(async () => {
TestBed.configureTestingModule({declarations: [TitleComponent]});
await TestBed.compileComponents();
});
it('should create the component', () => {
const fixture = TestBed.createComponent(TitleComponent);
const titleComp = fixture.componentInstance;
expect(titleComp).toBeTruthy();
});
it('should render the title using the specified app name', () => {
const fixture = TestBed.createComponent(TitleComponent);
const titleComp = fixture.componentInstance;
const titleElem = fixture.nativeElement;
titleComp.appName = 'Test';
fixture.detectChanges();
expect(titleElem.querySelector('h1').textContent).toBe('Test app is running!');
});
});