Browse Source

Refactor mock services to simplify super constructor calls

Updated MockPermissionService and MockRestService to call their super constructors without arguments, aligning with possible changes in the base class constructors. This simplifies the instantiation logic and removes unnecessary dependencies from the mock implementations.
pull/23262/head
Fahri Gedik 11 months ago
parent
commit
7621fc7fcd
  1. 3
      npm/ng-packs/packages/core/testing/src/lib/services/mock-permission.service.ts
  2. 3
      npm/ng-packs/packages/core/testing/src/lib/services/mock-rest.service.ts

3
npm/ng-packs/packages/core/testing/src/lib/services/mock-permission.service.ts

@ -9,8 +9,7 @@ export class MockPermissionService extends PermissionService {
constructor() {
const configState = inject(ConfigStateService);
super(configState);
super();
this.configState = configState;
this.grantAllPolicies();

3
npm/ng-packs/packages/core/testing/src/lib/services/mock-rest.service.ts

@ -3,7 +3,6 @@ import {
CORE_OPTIONS,
EnvironmentService,
ExternalHttpClient,
HttpErrorReporterService,
RestService,
} from '@abp/ng.core';
import { HttpClient } from '@angular/common/http';
@ -25,7 +24,7 @@ export class MockRestService extends RestService {
const externalhttp = inject(ExternalHttpClient);
const environment = inject(EnvironmentService);
super(options, http,externalhttp, environment, null as unknown as HttpErrorReporterService);
super();
this.options = options;
this.http = http;

Loading…
Cancel
Save