feat(herowars): migrate JSON static imports to HttpClient assets
Replace all TypeScript JSON imports with an HWDataService that loads 6 data files from /assets/files-data/ via HttpClient with shareReplay(1). Update all 9 consumer components to subscribe asynchronously. Remove unused qcm-bpa.json import and dead methods from QcmComponent. Add ADR 0013 documenting the decision.
This commit is contained in:
@@ -1,29 +1,32 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { provideNativeDateAdapter } from '@angular/material/core';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
|
||||
import { HerowarsComponent } from './herowars.component';
|
||||
|
||||
describe('HerowarsComponent', () => {
|
||||
let component: HerowarsComponent;
|
||||
let fixture: ComponentFixture<HerowarsComponent>;
|
||||
let component: HerowarsComponent;
|
||||
let fixture: ComponentFixture<HerowarsComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HerowarsComponent],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
provideNativeDateAdapter(),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(HerowarsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HerowarsComponent],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
provideNativeDateAdapter(),
|
||||
provideHttpClient(),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
}).compileComponents();
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
fixture = TestBed.createComponent(HerowarsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user