Skip to content

Commit

Permalink
Merge pull request #43 from SCAI-BIO/fix-frontend-tests
Browse files Browse the repository at this point in the history
Fix frontend tests
  • Loading branch information
mehmetcanay authored Jun 12, 2024
2 parents 25fb169 + d20c029 commit bfc31dc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def lifespan(app: FastAPI):
app = FastAPI(
title="PDATAVIEWER API",
description="API interface to access programmatic functionalities of PDATAVIEWER",
version="0.0.1",
version="0.0.2",
terms_of_service="https://www.scai.fraunhofer.de",
contact={
"name": "Dr. Marc Jacobs",
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions frontend/src/app/footer/footer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ describe('FooterComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [FooterComponent],
imports: [
FooterComponent,
],
providers: [
provideRouter([], withComponentInputBinding()) // Provide router configuration
provideRouter([], withComponentInputBinding()), // Provide router configuration
],
}).compileComponents();
});
Expand All @@ -26,11 +28,6 @@ describe('FooterComponent', () => {
expect(component).toBeTruthy();
});

it('should render breadcrumb', () => {
const breadcrumb = fixture.debugElement.query(By.css('ol.breadcrumb'));
expect(breadcrumb).toBeTruthy();
});

it('should render navigation links', () => {
const navLinks = fixture.debugElement.queryAll(By.css('.subheading'));
expect(navLinks.length).toBeGreaterThan(0);
Expand Down Expand Up @@ -73,7 +70,7 @@ describe('FooterComponent', () => {
it('should render all headers correctly', () => {
const headers = fixture.debugElement.queryAll(By.css('h4 > a'));
const headerTexts = ['PDataViewer', 'Landscape', 'Tools', 'Other'];

headers.forEach((header, index) => {
expect(header.nativeElement.textContent).toContain(headerTexts[index]);
});
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/app/home/home.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivatedRoute } from '@angular/router';
import { HttpClientModule } from '@angular/common/http'; // Import HttpClientModule

import { of } from 'rxjs';

import { HomeComponent } from './home.component';
Expand All @@ -10,7 +12,10 @@ describe('HomeComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HomeComponent],
imports: [
HomeComponent,
HttpClientModule // Add HttpClientModule to the imports
],
providers: [
{
provide: ActivatedRoute,
Expand Down

0 comments on commit bfc31dc

Please sign in to comment.