From 06624b8484231578626909b51596313cfc757802 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Tue, 21 Jan 2025 09:35:39 -0500 Subject: [PATCH] fix: unit tests --- apps/demo/src/app/app.component.html | 103 +++++++++--------- apps/demo/src/app/app.component.spec.ts | 15 +-- .../documentation.component.spec.ts | 4 +- .../getting-started.component.spec.ts | 4 +- src/app/app.component.spec.ts | 4 +- 5 files changed, 64 insertions(+), 66 deletions(-) diff --git a/apps/demo/src/app/app.component.html b/apps/demo/src/app/app.component.html index e51b7e4..9e53537 100644 --- a/apps/demo/src/app/app.component.html +++ b/apps/demo/src/app/app.component.html @@ -1,37 +1,40 @@ - -
- ngx-gauge - - +
@@ -40,28 +43,30 @@
-
-
\ No newline at end of file + diff --git a/apps/demo/src/app/app.component.spec.ts b/apps/demo/src/app/app.component.spec.ts index 9510495..fb9610e 100644 --- a/apps/demo/src/app/app.component.spec.ts +++ b/apps/demo/src/app/app.component.spec.ts @@ -1,9 +1,9 @@ -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ AppComponent @@ -11,22 +11,15 @@ describe('AppComponent', () => { }).compileComponents(); })); - it('should create the app', async(() => { + it('should create the app', waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); - it(`should have as title 'app'`, async(() => { + it(`should have as title 'app'`, waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app.title).toEqual('app'); })); - - it('should render title in a h1 tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); - })); }); diff --git a/apps/demo/src/app/documentation/documentation.component.spec.ts b/apps/demo/src/app/documentation/documentation.component.spec.ts index a736f59..56df16a 100644 --- a/apps/demo/src/app/documentation/documentation.component.spec.ts +++ b/apps/demo/src/app/documentation/documentation.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { DocumentationComponent } from './documentation.component'; @@ -6,7 +6,7 @@ describe('DocumentationComponent', () => { let component: DocumentationComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ DocumentationComponent ] }) diff --git a/apps/demo/src/app/getting-started/getting-started.component.spec.ts b/apps/demo/src/app/getting-started/getting-started.component.spec.ts index d367560..f5073e9 100644 --- a/apps/demo/src/app/getting-started/getting-started.component.spec.ts +++ b/apps/demo/src/app/getting-started/getting-started.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { GettingStartedComponent } from './getting-started.component'; @@ -6,7 +6,7 @@ describe('GettingStartedComponent', () => { let component: GettingStartedComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ GettingStartedComponent ] }) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 1fb7818..0364ce1 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,9 +1,9 @@ -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ RouterTestingModule