Browse Source

Merge pull request #19478 from abpframework/issue-19477

Angular: Add mock LocalizationPipe to CoreTestingModule
pull/19500/head
Masum ULU 2 years ago
committed by GitHub
parent
commit
ff8e29b858
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      npm/ng-packs/packages/core/testing/src/lib/core-testing.module.ts
  2. 1
      npm/ng-packs/packages/core/testing/src/lib/pipes/index.ts
  3. 12
      npm/ng-packs/packages/core/testing/src/lib/pipes/localization.pipe.ts
  4. 1
      npm/ng-packs/packages/core/testing/src/public-api.ts

3
npm/ng-packs/packages/core/testing/src/lib/core-testing.module.ts

@ -16,6 +16,7 @@ import { provideRoutes } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { MockPermissionService } from './services/mock-permission.service';
import { MockRestService } from './services/mock-rest.service';
import { LocalizationPipe } from './pipes';
/**
* CoreTestingModule is the module that will be used in tests
@ -23,7 +24,7 @@ import { MockRestService } from './services/mock-rest.service';
*/
@NgModule({
exports: [RouterTestingModule, BaseCoreModule],
imports: [NoopAnimationsModule, RouterTestingModule, BaseCoreModule],
imports: [NoopAnimationsModule, RouterTestingModule, BaseCoreModule, LocalizationPipe],
})
export class CoreTestingModule {
static withConfig(

1
npm/ng-packs/packages/core/testing/src/lib/pipes/index.ts

@ -0,0 +1 @@
export * from './localization.pipe';

12
npm/ng-packs/packages/core/testing/src/lib/pipes/localization.pipe.ts

@ -0,0 +1,12 @@
import { Injectable, Pipe, PipeTransform } from '@angular/core';
@Injectable()
@Pipe({
name: 'abpLocalization',
standalone: true,
})
export class LocalizationPipe implements PipeTransform {
transform(value: string): string {
return value;
}
}

1
npm/ng-packs/packages/core/testing/src/public-api.ts

@ -1,3 +1,4 @@
export * from './lib/core-testing.module';
export * from './lib/services';
export * from './lib/utils';
export * from './lib/pipes';

Loading…
Cancel
Save