Skip to content

Commit

Permalink
Add test file for connection-details.page.ts
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   src/app/pages/connect-page/connection-details/connection-details.spec.ts
  • Loading branch information
Jakersnell committed Sep 3, 2024
1 parent a918cf4 commit 84dad85
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { RouterTestingModule } from "@angular/router/testing";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import {ConnectionDetailsPage} from "./connection-details.page";
import {Constants} from "../../../_constants/constants"; // Import HttpClientTestingModule

describe('ConnectionDetailsPage', () => {
let component: ConnectionDetailsPage;
let fixture: ComponentFixture<ConnectionDetailsPage>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ConnectionDetailsPage ],
providers: [
{ provide: Constants, useClass: Constants }
],
imports: [
HttpClientTestingModule, // Use HttpClientTestingModule instead of HttpClientModule
RouterTestingModule.withRoutes([]),
IonicModule.forRoot()
]
}).compileComponents();

fixture = TestBed.createComponent(ConnectionDetailsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
});
});

0 comments on commit 84dad85

Please sign in to comment.