fix(frontend): restaure useMockFixtures à sa valeur d'origine après chaque test
L'afterEach forçait le drapeau à true alors qu'il vaut false dans les deux environnements : avec isolate désactivé, tout spec joué ensuite sur /stats/summary ou /alerts aurait reçu une fixture au lieu d'atteindre HttpTestingController.
This commit is contained in:
@@ -8,8 +8,10 @@ import { STATS_SUMMARY_FIXTURE } from '../mocks/stats-summary.fixture';
|
|||||||
describe('mockApiInterceptor', () => {
|
describe('mockApiInterceptor', () => {
|
||||||
let http: HttpClient;
|
let http: HttpClient;
|
||||||
let httpMock: HttpTestingController;
|
let httpMock: HttpTestingController;
|
||||||
|
let useMockFixturesInitial: boolean;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
useMockFixturesInitial = environment.useMockFixtures;
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
providers: [
|
providers: [
|
||||||
provideHttpClient(withInterceptors([mockApiInterceptor])),
|
provideHttpClient(withInterceptors([mockApiInterceptor])),
|
||||||
@@ -21,7 +23,7 @@ describe('mockApiInterceptor', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
environment.useMockFixtures = true;
|
environment.useMockFixtures = useMockFixturesInitial;
|
||||||
httpMock.verify();
|
httpMock.verify();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user