Skip to content

Commit 21c8844

Browse files
committed
fix test
1 parent f5e95c2 commit 21c8844

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/app/app.spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import { TestBed } from '@angular/core/testing';
2+
import { provideRouter } from '@angular/router';
3+
import { provideHttpClient } from '@angular/common/http';
24
import { App } from './app';
5+
import { APP_VERSION } from './app.config';
36

47
describe('App', () => {
58
beforeEach(async () => {
69
await TestBed.configureTestingModule({
710
imports: [App],
11+
providers: [
12+
provideRouter([]),
13+
provideHttpClient(),
14+
{ provide: APP_VERSION, useValue: '0.0.0-test' }
15+
]
816
}).compileComponents();
917
});
1018

@@ -14,10 +22,11 @@ describe('App', () => {
1422
expect(app).toBeTruthy();
1523
});
1624

17-
it('should render title', async () => {
25+
it('should render main layout', async () => {
1826
const fixture = TestBed.createComponent(App);
1927
await fixture.whenStable();
2028
const compiled = fixture.nativeElement as HTMLElement;
21-
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, temp');
29+
expect(compiled.querySelector('main')).toBeTruthy();
30+
expect(compiled.querySelector('router-outlet')).toBeTruthy();
2231
});
2332
});

0 commit comments

Comments
 (0)