b645f28daf
- Fix circular dependency in guildwar-attack/defence: import FortificationCardContentComponent directly instead of via @components/shared barrel - Add index === -1 guard in guildwar-attack, guildwar-defence, guildwar-teams _setChampionsByPower to avoid crash when members input is empty - Fix MembersStatisticsComponent to guard against undefined member in ngOnInit - Fix JumpComponent: initialize jump with sautants/author defaults to avoid template crash - Add provideRouter([]), provideHttpClient(), provideAnimations(), provideNativeDateAdapter() to 26 spec files missing them - Register Chart.js scales in chart component specs - Rewrite FrenchPaginator spec to instantiate service directly - Fix AppComponent spec assertions to match actual component - Re-enable npm test in .husky/pre-commit
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { TestBed } from '@angular/core/testing';
|
|
import { provideRouter } from '@angular/router';
|
|
import { provideHttpClient } from '@angular/common/http';
|
|
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
import { provideNativeDateAdapter } from '@angular/material/core';
|
|
import { AppComponent } from './app.component';
|
|
|
|
describe('AppComponent', () => {
|
|
beforeEach(async () => {
|
|
await TestBed.configureTestingModule({
|
|
imports: [AppComponent],
|
|
providers: [
|
|
provideRouter([]),
|
|
provideHttpClient(),
|
|
provideAnimations(),
|
|
provideNativeDateAdapter(),
|
|
],
|
|
}).compileComponents();
|
|
});
|
|
|
|
it('should create the app', () => {
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
const app = fixture.componentInstance;
|
|
expect(app).toBeTruthy();
|
|
});
|
|
|
|
it(`should have the 'Ad Astra' title`, () => {
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
const app = fixture.componentInstance;
|
|
expect(app.title).toEqual('Ad Astra');
|
|
});
|
|
|
|
it('should render the full layout', () => {
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
fixture.detectChanges();
|
|
const compiled = fixture.nativeElement as HTMLElement;
|
|
expect(compiled.querySelector('app-full-layout')).toBeTruthy();
|
|
});
|
|
});
|