fix(tests): fix all 39 failing specs and re-enable pre-commit hook
- 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
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
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();
|
||||
});
|
||||
|
||||
@@ -14,16 +24,16 @@ describe('AppComponent', () => {
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should have the 'adastra_angular' title`, () => {
|
||||
it(`should have the 'Ad Astra' title`, () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app.title).toEqual('adastra_angular');
|
||||
expect(app.title).toEqual('Ad Astra');
|
||||
});
|
||||
|
||||
it('should render title', () => {
|
||||
it('should render the full layout', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, adastra_angular');
|
||||
expect(compiled.querySelector('app-full-layout')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { AeronefsComponent } from './aeronefs.component';
|
||||
|
||||
describe('AeronefsComponent', () => {
|
||||
@@ -8,7 +12,13 @@ describe('AeronefsComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [AeronefsComponent]
|
||||
imports: [AeronefsComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { AuthComponent } from './auth.component';
|
||||
|
||||
@@ -8,8 +11,13 @@ describe('AuthComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AuthComponent]
|
||||
});
|
||||
imports: [AuthComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(AuthComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { CalculatorComponent } from './calculator.component';
|
||||
|
||||
describe('CalculatorComponent', () => {
|
||||
@@ -8,8 +14,14 @@ describe('CalculatorComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CalculatorComponent]
|
||||
});
|
||||
imports: [CalculatorComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(CalculatorComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { CanopiesComponent } from './canopies.component';
|
||||
|
||||
describe('CanopiesComponent', () => {
|
||||
@@ -8,7 +12,13 @@ describe('CanopiesComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CanopiesComponent]
|
||||
imports: [CanopiesComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { DashboardComponent } from './dashboard.component';
|
||||
|
||||
@@ -8,8 +11,13 @@ describe('DashboardComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [DashboardComponent]
|
||||
});
|
||||
imports: [DashboardComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(DashboardComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
|
||||
import { DemoComponent } from './demo.component';
|
||||
|
||||
@@ -8,7 +10,11 @@ describe('DemoComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [DemoComponent]
|
||||
imports: [DemoComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { GoogleMap, MapKmlLayer } from '@angular/google-maps';
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { DropzonesComponent } from './dropzones.component';
|
||||
|
||||
describe('DropzonesComponent', () => {
|
||||
@@ -8,10 +14,20 @@ describe('DropzonesComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [DropzonesComponent]
|
||||
imports: [DropzonesComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.overrideComponent(DropzonesComponent, {
|
||||
remove: { imports: [GoogleMap, MapKmlLayer] },
|
||||
add: { schemas: [CUSTOM_ELEMENTS_SCHEMA] },
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
fixture = TestBed.createComponent(DropzonesComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { HerowarsGuildraidComponent } from './herowars-guildraid.component';
|
||||
|
||||
@@ -8,7 +9,10 @@ describe('HerowarsGuildraidComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HerowarsGuildraidComponent]
|
||||
imports: [HerowarsGuildraidComponent],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { HerowarsGuildwarComponent } from './herowars-guildwar.component';
|
||||
|
||||
@@ -8,7 +10,11 @@ describe('HerowarsGuildwarComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HerowarsGuildwarComponent]
|
||||
imports: [HerowarsGuildwarComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { provideNativeDateAdapter } from '@angular/material/core';
|
||||
|
||||
import { HerowarsComponent } from './herowars.component';
|
||||
|
||||
@@ -8,7 +10,11 @@ describe('HerowarsComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HerowarsComponent]
|
||||
imports: [HerowarsComponent],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
provideNativeDateAdapter(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
@@ -8,7 +9,10 @@ describe('HomeComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HomeComponent]
|
||||
imports: [HomeComponent],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { ComponentFixture, 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 { MenuItems } from '@components/shared';
|
||||
import { JumpComponent } from './jump.component';
|
||||
|
||||
describe('JumpComponent', () => {
|
||||
@@ -8,7 +13,14 @@ describe('JumpComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [JumpComponent]
|
||||
imports: [JumpComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
provideNativeDateAdapter(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export class JumpComponent implements OnInit, OnDestroy {
|
||||
public title: string = '';
|
||||
public errors: Errors = { errors: {} };
|
||||
public destroyRef = inject(DestroyRef);
|
||||
public jump: Jump = {} as Jump;
|
||||
public jump: Jump = { sautants: [], author: {} } as unknown as Jump;
|
||||
public prevSlug: string = '';
|
||||
public nextSlug: string = '';
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { JumpsComponent } from './jumps.component';
|
||||
|
||||
describe('JumpsComponent', () => {
|
||||
@@ -8,8 +12,14 @@ describe('JumpsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [JumpsComponent]
|
||||
});
|
||||
imports: [JumpsComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(JumpsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { ComponentFixture, 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 { MenuItems } from '@components/shared';
|
||||
import { LogbookComponent } from './logbook.component';
|
||||
|
||||
describe('LogbookComponent', () => {
|
||||
@@ -8,8 +13,15 @@ describe('LogbookComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [LogbookComponent]
|
||||
});
|
||||
imports: [LogbookComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
provideNativeDateAdapter(),
|
||||
MenuItems,
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(LogbookComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { PageComponent } from './page.component';
|
||||
|
||||
@@ -8,7 +11,12 @@ describe('PageComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [PageComponent]
|
||||
imports: [PageComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { ProductComponent } from './product.component';
|
||||
|
||||
@@ -8,7 +11,12 @@ describe('ProductComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ProductComponent]
|
||||
imports: [ProductComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { ProductsComponent } from './products.component';
|
||||
|
||||
@@ -8,7 +11,12 @@ describe('ProductsComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ProductsComponent]
|
||||
imports: [ProductsComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
|
||||
import { ProfileComponent } from './profile.component';
|
||||
|
||||
@@ -8,8 +10,12 @@ describe('ProfileComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProfileComponent]
|
||||
});
|
||||
imports: [ProfileComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(ProfileComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { QcmComponent } from './qcm.component';
|
||||
|
||||
describe('QcmComponent', () => {
|
||||
@@ -8,7 +11,12 @@ describe('QcmComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [QcmComponent]
|
||||
imports: [QcmComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
MenuItems,
|
||||
],
|
||||
});
|
||||
fixture = TestBed.createComponent(QcmComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { CredentialsComponent } from './credentials.component';
|
||||
|
||||
@@ -8,7 +11,12 @@ describe('CredentialsComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CredentialsComponent]
|
||||
imports: [CredentialsComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { SettingsComponent } from './settings.component';
|
||||
|
||||
@@ -8,7 +11,12 @@ describe('SettingsComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [SettingsComponent]
|
||||
imports: [SettingsComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+13
-3
@@ -1,5 +1,10 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { AeronefsBarComponent } from './aeronefs-bar.component';
|
||||
|
||||
describe('AeronefsBarComponent', () => {
|
||||
@@ -7,9 +12,14 @@ describe('AeronefsBarComponent', () => {
|
||||
let fixture: ComponentFixture<AeronefsBarComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AeronefsBarComponent]
|
||||
})
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AeronefsBarComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+12
-2
@@ -1,5 +1,10 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { AeronefsPieComponent } from './aeronefs-pie.component';
|
||||
|
||||
describe('AeronefsPieComponent', () => {
|
||||
@@ -8,8 +13,13 @@ describe('AeronefsPieComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AeronefsPieComponent]
|
||||
})
|
||||
imports: [AeronefsPieComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+12
-2
@@ -1,5 +1,10 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { CanopiesModelsComponent } from './canopies-models.component';
|
||||
|
||||
describe('CanopiesModelsComponent', () => {
|
||||
@@ -8,8 +13,13 @@ describe('CanopiesModelsComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CanopiesModelsComponent]
|
||||
})
|
||||
imports: [CanopiesModelsComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+12
-2
@@ -1,5 +1,10 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { CanopiesSizesComponent } from './canopies-sizes.component';
|
||||
|
||||
describe('CanopiesSizesComponent', () => {
|
||||
@@ -8,8 +13,13 @@ describe('CanopiesSizesComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CanopiesSizesComponent]
|
||||
})
|
||||
imports: [CanopiesSizesComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+12
-2
@@ -1,5 +1,10 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { DropzonesBarComponent } from './dropzones-bar.component';
|
||||
|
||||
describe('DropzonesBarComponent', () => {
|
||||
@@ -8,8 +13,13 @@ describe('DropzonesBarComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [DropzonesBarComponent]
|
||||
})
|
||||
imports: [DropzonesBarComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+12
-2
@@ -1,5 +1,10 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController } from 'chart.js';
|
||||
Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ArcElement, LineElement, PointElement, DoughnutController, PieController);
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { DropzonesPieComponent } from './dropzones-pie.component';
|
||||
|
||||
describe('DropzonesPieComponent', () => {
|
||||
@@ -8,8 +13,13 @@ describe('DropzonesPieComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [DropzonesPieComponent]
|
||||
})
|
||||
imports: [DropzonesPieComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
+11
-3
@@ -1,5 +1,8 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { MenuItems } from '@components/shared';
|
||||
import { JumpsByMonthComponent } from './jumps-by-month.component';
|
||||
|
||||
describe('JumpsByMonthComponent', () => {
|
||||
@@ -7,9 +10,14 @@ describe('JumpsByMonthComponent', () => {
|
||||
let fixture: ComponentFixture<JumpsByMonthComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [JumpsByMonthComponent]
|
||||
})
|
||||
TestBed.configureTestingModule({
|
||||
imports: [JumpsByMonthComponent],
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
MenuItems,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FrenchPaginator } from './french-paginator.component';
|
||||
|
||||
describe('FrenchPaginator', () => {
|
||||
let component: FrenchPaginator;
|
||||
let fixture: ComponentFixture<FrenchPaginator>;
|
||||
let paginator: FrenchPaginator;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [FrenchPaginator]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FrenchPaginator);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
beforeEach(() => {
|
||||
paginator = new FrenchPaginator();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
expect(paginator).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+7
-1
@@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { provideNativeDateAdapter } from '@angular/material/core';
|
||||
|
||||
import { GuildraidsLogComponent } from './guildraids-log.component';
|
||||
|
||||
@@ -8,7 +10,11 @@ describe('GuildraidsLogComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [GuildraidsLogComponent]
|
||||
imports: [GuildraidsLogComponent],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
provideNativeDateAdapter(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
+2
-1
@@ -4,7 +4,7 @@ import { MatCardModule } from '@angular/material/card';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
import { FortificationCardContentComponent } from '@components/shared';
|
||||
import { FortificationCardContentComponent } from '../fortification-card-content/fortification-card-content.component';
|
||||
import {
|
||||
HWGuildWarEnemySlot, HWGuildWarEnemyTeam, HWGuildWarFortification,
|
||||
HWGuildWarHeroTeam, HWGuildWarTitanTeam, HWGuildWarSlots, HWMember
|
||||
@@ -194,6 +194,7 @@ export class GuildwarAttackComponent implements OnInit {
|
||||
private _setChampionsByPower(): void {
|
||||
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
||||
const index = this.guildMembers.findIndex(member => member.id === teamId);
|
||||
if (index === -1) continue;
|
||||
let totalHeroPower = 0;
|
||||
let totalTitanPower = 0;
|
||||
const heroes: HWGuildWarHeroTeam[] = [];
|
||||
|
||||
+8
-6
@@ -4,7 +4,7 @@ import { MatCardModule } from '@angular/material/card';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
import { FortificationCardContentComponent } from '@components/shared';
|
||||
import { FortificationCardContentComponent } from '../fortification-card-content/fortification-card-content.component';
|
||||
//import { HWMember } from '@models';
|
||||
import { HWGuildWarFortification, HWGuildWarHeroTeam, HWGuildWarSlots, HWGuildWarTitanTeam, HWMember } from '@models';
|
||||
|
||||
@@ -41,6 +41,7 @@ export class GuildwarDefenceComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
||||
const index = this.guildMembers.findIndex(member => member.id === teamId);
|
||||
if (index === -1) continue;
|
||||
let totalHeroPower = 0;
|
||||
let totalTitanPower = 0;
|
||||
const heroes: HWGuildWarHeroTeam[] = [];
|
||||
@@ -82,15 +83,16 @@ export class GuildwarDefenceComponent implements OnInit {
|
||||
const slots: HWGuildWarSlots = guildWarSlots.slots;
|
||||
let count = 0;
|
||||
indexes.forEach((data) => {
|
||||
const member = this._championsByPower[data];
|
||||
if (!member) return;
|
||||
switch (type) {
|
||||
case 'heroes':
|
||||
//console.log(name, data, this._championsByPower[data]);
|
||||
teams.push(this._championsByPower[data]);
|
||||
count += this._championsByPower[data].heroes.power;
|
||||
teams.push(member);
|
||||
count += member.heroes.power;
|
||||
break;
|
||||
case 'titans':
|
||||
teams.push(this._championsByPower[data]);
|
||||
count += this._championsByPower[data].titans.power;
|
||||
teams.push(member);
|
||||
count += member.titans.power;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ export class GuildwarTeamsComponent implements OnInit {
|
||||
|
||||
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
||||
const index = this._championsByPower.findIndex(member => member.id === teamId);
|
||||
if (index === -1) continue;
|
||||
let totalHeroPower = 0;
|
||||
let totalTitanPower = 0;
|
||||
const heroes: HWGuildWarHeroTeam[] = [];
|
||||
|
||||
+2
@@ -94,6 +94,8 @@ export class MembersStatisticsComponent implements OnInit {
|
||||
const index = this._membersByName.findIndex(member => member.id === data[1].userId);
|
||||
if (index !== -1) {
|
||||
this._membersByName[index].stat = stat;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
this._membersByName[index].score = (this._membersByName[index].stat.dungeonActivitySum + this._membersByName[index].stat.activitySum + this._membersByName[index].stat.prestigeSum);
|
||||
this._membersByName[index].warGifts = (((guildData.clan.giftsCount / 2) * ((this._membersByName[index].clanWarSum * 10) / 100)) / 20);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
import { FullComponent } from './full.component';
|
||||
|
||||
@@ -8,7 +11,12 @@ describe('FullComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [FullComponent]
|
||||
imports: [FullComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
provideAnimations(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
|
||||
import { HeaderComponent } from './header.component';
|
||||
|
||||
@@ -8,7 +10,11 @@ describe('HeaderComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HeaderComponent]
|
||||
imports: [HeaderComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideHttpClient(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user