Fixed problems
Build, Test & Push Frontend / quality-check (push) Successful in 1m16s
Build, Test & Push Frontend / docker (push) Successful in 2m45s

This commit is contained in:
Andreas Dahm committed 2026-09-18 15:39:43 +02:00
1 parent 5c2b6ed8a2
commit 6121fa553a
2 files changed
+24 -2

No files matched your search

+5
View File
@@ -96,6 +96,11 @@
{ {
"glob": "**/*", "glob": "**/*",
"input": "public" "input": "public"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
} }
], ],
"styles": [ "styles": [
+19 -2
View File
@@ -1,7 +1,8 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { Component, provideZonelessChangeDetection } from '@angular/core'; import { Component, provideZonelessChangeDetection } from '@angular/core';
import { MatCardModule } from '@angular/material/card'; import { MatCardModule } from '@angular/material/card';
import { By } from '@angular/platform-browser'; import { By, DomSanitizer } from '@angular/platform-browser';
import { MatIconRegistry } from '@angular/material/icon';
import { provideRouter } from '@angular/router'; import { provideRouter } from '@angular/router';
import { provideTranslateService } from '@ngx-translate/core'; import { provideTranslateService } from '@ngx-translate/core';
import { AboutComponent } from './about.component'; import { AboutComponent } from './about.component';
@@ -26,10 +27,26 @@ describe('AboutComponent', () => {
], ],
}).compileComponents(); }).compileComponents();
registerStubIcons();
fixture = TestBed.createComponent(AboutComponent); fixture = TestBed.createComponent(AboutComponent);
fixture.detectChanges(); fixture.detectChanges();
}); });
/**
* The real SVG icons are registered by an app initializer that TestBed never
* runs, so mat-icon logs a lookup error for every fixture. Literals keep the
* registry satisfied without pulling HttpClient into these tests.
*/
function registerStubIcons(): void {
const iconRegistry = TestBed.inject(MatIconRegistry);
const sanitizer = TestBed.inject(DomSanitizer);
const emptyIcon = sanitizer.bypassSecurityTrustHtml('<svg></svg>');
iconRegistry.addSvgIconLiteral('linkedin', emptyIcon);
iconRegistry.addSvgIconLiteral('github', emptyIcon);
}
function textOf(selector: string): string[] { function textOf(selector: string): string[] {
return fixture.debugElement return fixture.debugElement
.queryAll(By.css(selector)) .queryAll(By.css(selector))
@@ -163,7 +180,7 @@ describe('AboutComponent', () => {
const mailButton = fixture.debugElement.query(By.css('[data-testid="contact-mail"]')).nativeElement; const mailButton = fixture.debugElement.query(By.css('[data-testid="contact-mail"]')).nativeElement;
const siblingLink = fixture.debugElement const siblingLink = fixture.debugElement
.queryAll(By.css('a')) .queryAll(By.css('a'))
.find(anchor => anchor.nativeElement.textContent.trim() === 'Codeberg')!.nativeElement; .find(anchor => anchor.nativeElement.textContent.trim() === 'Gitea')!.nativeElement;
const buttonStyle = getComputedStyle(mailButton); const buttonStyle = getComputedStyle(mailButton);
const linkStyle = getComputedStyle(siblingLink); const linkStyle = getComputedStyle(siblingLink);