Skip to content

Commit

Permalink
feat(related-products): add testing driver module (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 authored Sep 11, 2021
1 parent 6538e52 commit 9112bfd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
3 changes: 1 addition & 2 deletions libs/related-products/driver/testing/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// TODO: implement
export {};
export { DaffRelatedProductsTestingDriverModule } from './testing.module';
31 changes: 31 additions & 0 deletions libs/related-products/driver/testing/src/testing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { CommonModule } from '@angular/common';
import {
NgModule,
ModuleWithProviders,
} from '@angular/core';

import { DAFF_PRODUCT_EXTRA_FACTORIES } from '@daffodil/product/testing';
import { DaffRelatedProductFactory } from '@daffodil/related-products/testing';

/**
* Module for providing the related product fields to the product extension factory.
*/
@NgModule({
imports: [
CommonModule,
],
})
export class DaffRelatedProductsTestingDriverModule {
static forRoot(): ModuleWithProviders<DaffRelatedProductsTestingDriverModule> {
return {
ngModule: DaffRelatedProductsTestingDriverModule,
providers: [
{
provide: DAFF_PRODUCT_EXTRA_FACTORIES,
useExisting: DaffRelatedProductFactory,
multi: true,
},
],
};
}
}

0 comments on commit 9112bfd

Please sign in to comment.