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:
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(grep \" FAILED$\")",
|
||||||
|
"Bash(grep -A2 \" FAILED$\")",
|
||||||
|
"Bash(grep -A3 \" FAILED$\")",
|
||||||
|
"Bash(grep -v \"Executed\\\\|^--$\")",
|
||||||
|
"Bash(grep -E \"TOTAL:|FAILED$\")",
|
||||||
|
"Bash(node -e \"const c = require\\('chart.js'\\); console.log\\(Object.keys\\(c\\).filter\\(k => k.includes\\('Doughnut'\\) || k.includes\\('Controller'\\)\\)\\)\")"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
# npm test -- --watch=false
|
npm test -- --watch=false
|
||||||
#prettier $(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') --write --ignore-unknown
|
#prettier $(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') --write --ignore-unknown
|
||||||
#git update-index --again
|
#git update-index --again
|
||||||
@@ -1,10 +1,20 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
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';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [AppComponent],
|
imports: [AppComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
provideNativeDateAdapter(),
|
||||||
|
],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -14,16 +24,16 @@ describe('AppComponent', () => {
|
|||||||
expect(app).toBeTruthy();
|
expect(app).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have the 'adastra_angular' title`, () => {
|
it(`should have the 'Ad Astra' title`, () => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
const app = fixture.componentInstance;
|
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);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const compiled = fixture.nativeElement as HTMLElement;
|
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 { 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';
|
import { AeronefsComponent } from './aeronefs.component';
|
||||||
|
|
||||||
describe('AeronefsComponent', () => {
|
describe('AeronefsComponent', () => {
|
||||||
@@ -8,7 +12,13 @@ describe('AeronefsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [AeronefsComponent]
|
imports: [AeronefsComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { AuthComponent } from './auth.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('AuthComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AuthComponent]
|
imports: [AuthComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(AuthComponent);
|
fixture = TestBed.createComponent(AuthComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { CalculatorComponent } from './calculator.component';
|
||||||
|
|
||||||
describe('CalculatorComponent', () => {
|
describe('CalculatorComponent', () => {
|
||||||
@@ -8,7 +14,13 @@ describe('CalculatorComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [CalculatorComponent]
|
imports: [CalculatorComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(CalculatorComponent);
|
fixture = TestBed.createComponent(CalculatorComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { CanopiesComponent } from './canopies.component';
|
||||||
|
|
||||||
describe('CanopiesComponent', () => {
|
describe('CanopiesComponent', () => {
|
||||||
@@ -8,7 +12,13 @@ describe('CanopiesComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [CanopiesComponent]
|
imports: [CanopiesComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { DashboardComponent } from './dashboard.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('DashboardComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [DashboardComponent]
|
imports: [DashboardComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(DashboardComponent);
|
fixture = TestBed.createComponent(DashboardComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
import { DemoComponent } from './demo.component';
|
import { DemoComponent } from './demo.component';
|
||||||
|
|
||||||
@@ -8,7 +10,11 @@ describe('DemoComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [DemoComponent]
|
imports: [DemoComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { DropzonesComponent } from './dropzones.component';
|
||||||
|
|
||||||
describe('DropzonesComponent', () => {
|
describe('DropzonesComponent', () => {
|
||||||
@@ -8,7 +14,17 @@ describe('DropzonesComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [DropzonesComponent]
|
imports: [DropzonesComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
.overrideComponent(DropzonesComponent, {
|
||||||
|
remove: { imports: [GoogleMap, MapKmlLayer] },
|
||||||
|
add: { schemas: [CUSTOM_ELEMENTS_SCHEMA] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { HerowarsGuildraidComponent } from './herowars-guildraid.component';
|
import { HerowarsGuildraidComponent } from './herowars-guildraid.component';
|
||||||
|
|
||||||
@@ -8,7 +9,10 @@ describe('HerowarsGuildraidComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [HerowarsGuildraidComponent]
|
imports: [HerowarsGuildraidComponent],
|
||||||
|
providers: [
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { HerowarsGuildwarComponent } from './herowars-guildwar.component';
|
||||||
|
|
||||||
@@ -8,7 +10,11 @@ describe('HerowarsGuildwarComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [HerowarsGuildwarComponent]
|
imports: [HerowarsGuildwarComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { HerowarsComponent } from './herowars.component';
|
||||||
|
|
||||||
@@ -8,7 +10,11 @@ describe('HerowarsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [HerowarsComponent]
|
imports: [HerowarsComponent],
|
||||||
|
providers: [
|
||||||
|
provideAnimations(),
|
||||||
|
provideNativeDateAdapter(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { HomeComponent } from './home.component';
|
import { HomeComponent } from './home.component';
|
||||||
|
|
||||||
@@ -8,7 +9,10 @@ describe('HomeComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [HomeComponent]
|
imports: [HomeComponent],
|
||||||
|
providers: [
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { JumpComponent } from './jump.component';
|
||||||
|
|
||||||
describe('JumpComponent', () => {
|
describe('JumpComponent', () => {
|
||||||
@@ -8,7 +13,14 @@ describe('JumpComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [JumpComponent]
|
imports: [JumpComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
provideNativeDateAdapter(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class JumpComponent implements OnInit, OnDestroy {
|
|||||||
public title: string = '';
|
public title: string = '';
|
||||||
public errors: Errors = { errors: {} };
|
public errors: Errors = { errors: {} };
|
||||||
public destroyRef = inject(DestroyRef);
|
public destroyRef = inject(DestroyRef);
|
||||||
public jump: Jump = {} as Jump;
|
public jump: Jump = { sautants: [], author: {} } as unknown as Jump;
|
||||||
public prevSlug: string = '';
|
public prevSlug: string = '';
|
||||||
public nextSlug: string = '';
|
public nextSlug: string = '';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { JumpsComponent } from './jumps.component';
|
||||||
|
|
||||||
describe('JumpsComponent', () => {
|
describe('JumpsComponent', () => {
|
||||||
@@ -8,7 +12,13 @@ describe('JumpsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [JumpsComponent]
|
imports: [JumpsComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(JumpsComponent);
|
fixture = TestBed.createComponent(JumpsComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { LogbookComponent } from './logbook.component';
|
||||||
|
|
||||||
describe('LogbookComponent', () => {
|
describe('LogbookComponent', () => {
|
||||||
@@ -8,7 +13,14 @@ describe('LogbookComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [LogbookComponent]
|
imports: [LogbookComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
provideNativeDateAdapter(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(LogbookComponent);
|
fixture = TestBed.createComponent(LogbookComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { PageComponent } from './page.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('PageComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [PageComponent]
|
imports: [PageComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { ProductComponent } from './product.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('ProductComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [ProductComponent]
|
imports: [ProductComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { ProductsComponent } from './products.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('ProductsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [ProductsComponent]
|
imports: [ProductsComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
import { ProfileComponent } from './profile.component';
|
import { ProfileComponent } from './profile.component';
|
||||||
|
|
||||||
@@ -8,7 +10,11 @@ describe('ProfileComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ProfileComponent]
|
imports: [ProfileComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(ProfileComponent);
|
fixture = TestBed.createComponent(ProfileComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { QcmComponent } from './qcm.component';
|
||||||
|
|
||||||
describe('QcmComponent', () => {
|
describe('QcmComponent', () => {
|
||||||
@@ -8,7 +11,12 @@ describe('QcmComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [QcmComponent]
|
imports: [QcmComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(QcmComponent);
|
fixture = TestBed.createComponent(QcmComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { CredentialsComponent } from './credentials.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('CredentialsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [CredentialsComponent]
|
imports: [CredentialsComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { SettingsComponent } from './settings.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('SettingsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [SettingsComponent]
|
imports: [SettingsComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,10 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { AeronefsBarComponent } from './aeronefs-bar.component';
|
||||||
|
|
||||||
describe('AeronefsBarComponent', () => {
|
describe('AeronefsBarComponent', () => {
|
||||||
@@ -8,7 +13,12 @@ describe('AeronefsBarComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AeronefsBarComponent]
|
imports: [AeronefsBarComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,10 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { AeronefsPieComponent } from './aeronefs-pie.component';
|
||||||
|
|
||||||
describe('AeronefsPieComponent', () => {
|
describe('AeronefsPieComponent', () => {
|
||||||
@@ -8,7 +13,12 @@ describe('AeronefsPieComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AeronefsPieComponent]
|
imports: [AeronefsPieComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,10 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { CanopiesModelsComponent } from './canopies-models.component';
|
||||||
|
|
||||||
describe('CanopiesModelsComponent', () => {
|
describe('CanopiesModelsComponent', () => {
|
||||||
@@ -8,7 +13,12 @@ describe('CanopiesModelsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [CanopiesModelsComponent]
|
imports: [CanopiesModelsComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,10 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { CanopiesSizesComponent } from './canopies-sizes.component';
|
||||||
|
|
||||||
describe('CanopiesSizesComponent', () => {
|
describe('CanopiesSizesComponent', () => {
|
||||||
@@ -8,7 +13,12 @@ describe('CanopiesSizesComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [CanopiesSizesComponent]
|
imports: [CanopiesSizesComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,10 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { DropzonesBarComponent } from './dropzones-bar.component';
|
||||||
|
|
||||||
describe('DropzonesBarComponent', () => {
|
describe('DropzonesBarComponent', () => {
|
||||||
@@ -8,7 +13,12 @@ describe('DropzonesBarComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [DropzonesBarComponent]
|
imports: [DropzonesBarComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,10 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { DropzonesPieComponent } from './dropzones-pie.component';
|
||||||
|
|
||||||
describe('DropzonesPieComponent', () => {
|
describe('DropzonesPieComponent', () => {
|
||||||
@@ -8,7 +13,12 @@ describe('DropzonesPieComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [DropzonesPieComponent]
|
imports: [DropzonesPieComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
+9
-1
@@ -1,5 +1,8 @@
|
|||||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { JumpsByMonthComponent } from './jumps-by-month.component';
|
||||||
|
|
||||||
describe('JumpsByMonthComponent', () => {
|
describe('JumpsByMonthComponent', () => {
|
||||||
@@ -8,7 +11,12 @@ describe('JumpsByMonthComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [JumpsByMonthComponent]
|
imports: [JumpsByMonthComponent],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
MenuItems,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -1,24 +1,14 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { FrenchPaginator } from './french-paginator.component';
|
import { FrenchPaginator } from './french-paginator.component';
|
||||||
|
|
||||||
describe('FrenchPaginator', () => {
|
describe('FrenchPaginator', () => {
|
||||||
let component: FrenchPaginator;
|
let paginator: FrenchPaginator;
|
||||||
let fixture: ComponentFixture<FrenchPaginator>;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(() => {
|
||||||
await TestBed.configureTestingModule({
|
paginator = new FrenchPaginator();
|
||||||
imports: [FrenchPaginator]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(FrenchPaginator);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(paginator).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -1,4 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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';
|
import { GuildraidsLogComponent } from './guildraids-log.component';
|
||||||
|
|
||||||
@@ -8,7 +10,11 @@ describe('GuildraidsLogComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [GuildraidsLogComponent]
|
imports: [GuildraidsLogComponent],
|
||||||
|
providers: [
|
||||||
|
provideAnimations(),
|
||||||
|
provideNativeDateAdapter(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -4,7 +4,7 @@ import { MatCardModule } from '@angular/material/card';
|
|||||||
import { MatDividerModule } from '@angular/material/divider';
|
import { MatDividerModule } from '@angular/material/divider';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
|
||||||
import { FortificationCardContentComponent } from '@components/shared';
|
import { FortificationCardContentComponent } from '../fortification-card-content/fortification-card-content.component';
|
||||||
import {
|
import {
|
||||||
HWGuildWarEnemySlot, HWGuildWarEnemyTeam, HWGuildWarFortification,
|
HWGuildWarEnemySlot, HWGuildWarEnemyTeam, HWGuildWarFortification,
|
||||||
HWGuildWarHeroTeam, HWGuildWarTitanTeam, HWGuildWarSlots, HWMember
|
HWGuildWarHeroTeam, HWGuildWarTitanTeam, HWGuildWarSlots, HWMember
|
||||||
@@ -194,6 +194,7 @@ export class GuildwarAttackComponent implements OnInit {
|
|||||||
private _setChampionsByPower(): void {
|
private _setChampionsByPower(): void {
|
||||||
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
||||||
const index = this.guildMembers.findIndex(member => member.id === teamId);
|
const index = this.guildMembers.findIndex(member => member.id === teamId);
|
||||||
|
if (index === -1) continue;
|
||||||
let totalHeroPower = 0;
|
let totalHeroPower = 0;
|
||||||
let totalTitanPower = 0;
|
let totalTitanPower = 0;
|
||||||
const heroes: HWGuildWarHeroTeam[] = [];
|
const heroes: HWGuildWarHeroTeam[] = [];
|
||||||
|
|||||||
+8
-6
@@ -4,7 +4,7 @@ import { MatCardModule } from '@angular/material/card';
|
|||||||
import { MatDividerModule } from '@angular/material/divider';
|
import { MatDividerModule } from '@angular/material/divider';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
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 { HWMember } from '@models';
|
||||||
import { HWGuildWarFortification, HWGuildWarHeroTeam, HWGuildWarSlots, HWGuildWarTitanTeam, HWMember } from '@models';
|
import { HWGuildWarFortification, HWGuildWarHeroTeam, HWGuildWarSlots, HWGuildWarTitanTeam, HWMember } from '@models';
|
||||||
|
|
||||||
@@ -41,6 +41,7 @@ export class GuildwarDefenceComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
||||||
const index = this.guildMembers.findIndex(member => member.id === teamId);
|
const index = this.guildMembers.findIndex(member => member.id === teamId);
|
||||||
|
if (index === -1) continue;
|
||||||
let totalHeroPower = 0;
|
let totalHeroPower = 0;
|
||||||
let totalTitanPower = 0;
|
let totalTitanPower = 0;
|
||||||
const heroes: HWGuildWarHeroTeam[] = [];
|
const heroes: HWGuildWarHeroTeam[] = [];
|
||||||
@@ -82,15 +83,16 @@ export class GuildwarDefenceComponent implements OnInit {
|
|||||||
const slots: HWGuildWarSlots = guildWarSlots.slots;
|
const slots: HWGuildWarSlots = guildWarSlots.slots;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
indexes.forEach((data) => {
|
indexes.forEach((data) => {
|
||||||
|
const member = this._championsByPower[data];
|
||||||
|
if (!member) return;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'heroes':
|
case 'heroes':
|
||||||
//console.log(name, data, this._championsByPower[data]);
|
teams.push(member);
|
||||||
teams.push(this._championsByPower[data]);
|
count += member.heroes.power;
|
||||||
count += this._championsByPower[data].heroes.power;
|
|
||||||
break;
|
break;
|
||||||
case 'titans':
|
case 'titans':
|
||||||
teams.push(this._championsByPower[data]);
|
teams.push(member);
|
||||||
count += this._championsByPower[data].titans.power;
|
count += member.titans.power;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
+1
@@ -48,6 +48,7 @@ export class GuildwarTeamsComponent implements OnInit {
|
|||||||
|
|
||||||
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
for (const [teamId, teamValues] of Object.entries(guildWarData.teams)) {
|
||||||
const index = this._championsByPower.findIndex(member => member.id === teamId);
|
const index = this._championsByPower.findIndex(member => member.id === teamId);
|
||||||
|
if (index === -1) continue;
|
||||||
let totalHeroPower = 0;
|
let totalHeroPower = 0;
|
||||||
let totalTitanPower = 0;
|
let totalTitanPower = 0;
|
||||||
const heroes: HWGuildWarHeroTeam[] = [];
|
const heroes: HWGuildWarHeroTeam[] = [];
|
||||||
|
|||||||
+2
@@ -94,6 +94,8 @@ export class MembersStatisticsComponent implements OnInit {
|
|||||||
const index = this._membersByName.findIndex(member => member.id === data[1].userId);
|
const index = this._membersByName.findIndex(member => member.id === data[1].userId);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
this._membersByName[index].stat = stat;
|
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].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);
|
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 { 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';
|
import { FullComponent } from './full.component';
|
||||||
|
|
||||||
@@ -8,7 +11,12 @@ describe('FullComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [FullComponent]
|
imports: [FullComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
provideAnimations(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
import { HeaderComponent } from './header.component';
|
import { HeaderComponent } from './header.component';
|
||||||
|
|
||||||
@@ -8,7 +10,11 @@ describe('HeaderComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [HeaderComponent]
|
imports: [HeaderComponent],
|
||||||
|
providers: [
|
||||||
|
provideRouter([]),
|
||||||
|
provideHttpClient(),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user