How to use the @ngrx/store.combineReducers function in @ngrx/store

To help you get started, we’ve selected a few @ngrx/store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github intershop / intershop-pwa / src / app / shared / basket / components / basket-validation-results / basket-validation-results.component.spec.ts View on Github external
beforeEach(async(() => {
    checkoutFacadeMock = mock(CheckoutFacade);
    when(checkoutFacadeMock.basketValidationResults$).thenReturn(of(undefined));

    TestBed.configureTestingModule({
      declarations: [
        BasketValidationResultsComponent,
        MockComponent(BasketValidationItemsComponent),
        MockComponent(BasketValidationProductsComponent),
      ],
      imports: [
        TranslateModule.forRoot(),
        ngrxTesting({
          reducers: {
            checkout: combineReducers(checkoutReducers),
          },
        }),
      ],
      providers: [{ provide: CheckoutFacade, useFactory: () => instance(checkoutFacadeMock) }],
    }).compileComponents();
  }));
github intershop / intershop-pwa / src / app / core / store / checkout / basket / basket-payment.effects.spec.ts View on Github external
beforeEach(() => {
    basketPaymentServiceMock = mock(BasketPaymentService);

    TestBed.configureTestingModule({
      imports: [
        ngrxTesting({
          reducers: {
            ...coreReducers,
            shopping: combineReducers(shoppingReducers),
            checkout: combineReducers(checkoutReducers),
          },
        }),
      ],
      providers: [
        BasketPaymentEffects,
        provideMockActions(() => actions$),
        { provide: BasketPaymentService, useFactory: () => instance(basketPaymentServiceMock) },
      ],
    });

    effects = TestBed.get(BasketPaymentEffects);
    store$ = TestBed.get(Store);
  });
github graycoreio / daffodil / libs / state / src / product / containers / best-sellers / best-sellers.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        StoreModule.forRoot({
          products: combineReducers(fromProduct.reducers),
        })
      ],
      declarations: [ BestSellersContainer ]
    })
    .compileComponents();
  }));
github intershop / intershop-pwa / src / app / core / store / shopping / categories / categories.selectors.spec.ts View on Github external
beforeEach(() => {
    prod = { sku: 'sku' } as Product;
    cat = { uniqueId: 'Aa', categoryPath: ['Aa'] } as Category;
    cat.hasOnlineProducts = true;

    TestBed.configureTestingModule({
      imports: ngrxTesting({
        shopping: combineReducers(shoppingReducers),
      }),
    });

    store$ = TestBed.get(TestStore);
  });
github seokju-na / geeks-diary / src / browser / vcs / vcs-local / vcs-commit-dialog / vcs-commit-dialog.component.spec.ts View on Github external
beforeAll(async () => {
        mockDialog = new MockDialog();
        mockDialogRef = new MockDialogRef(mockDialog, VcsCommitDialogComponent);

        await TestBed
            .configureTestingModule({
                imports: [
                    UiModule,
                    VcsViewModule,
                    VcsRemoteModule,
                    NoopAnimationsModule,
                    StoreModule.forRoot({
                        vcs: combineReducers(vcsReducerMap),
                    }),
                ],
                providers: [
                    {
                        provide: VCS_ITEM_MAKING_FACTORIES,
                        useFactory(factory: BaseVcsItemFactory) {
                            return [factory];
                        },
                        deps: [BaseVcsItemFactory],
                    },
                    { provide: DialogRef, useValue: mockDialogRef },
                    { provide: WORKSPACE_DEFAULT_CONFIG, useValue: workspaceConfig },
                    VcsAccountDatabaseProvider,
                ],
                declarations: [
                    VcsCommitDialogComponent,
github seokju-na / geeks-diary / src / browser / note / note-editor / note-content.effects.spec.ts View on Github external
beforeAll(() => {
        actions = new ReplaySubject(1);
        noteEditor = jasmine.createSpyObj('editor', [
            'loadNoteContent',
            'saveNote',
        ]);
        listManager = jasmine.createSpyObj('listManager', [
            'resizeSnippets',
        ]);

        TestBed
            .configureTestingModule({
                imports: [
                    StoreModule.forRoot({
                        note: combineReducers(noteReducerMap),
                    }),
                ],
                providers: [
                    { provide: NoteEditorService, useValue: noteEditor },
                    { provide: NoteSnippetListManager, useValue: listManager },
                    NoteContentEffects,
                    provideMockActions(() => actions),
                ],
            });
    });
github SAP / cloud-commerce-spartacus-storefront / src / app / product / guards / product.guard.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        StoreModule.forRoot({
          ...fromRoot.reducers,
          products: combineReducers(fromStore.reducers)
        })
      ],
      providers: [ProductGuard]
    });

    productGuard = TestBed.get(ProductGuard);
    store = TestBed.get(Store);
  });
github SAP / cloud-commerce-spartacus-storefront / src / app / product / components / product-list / container / product-list.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        MaterialModule,
        RouterTestingModule,
        StoreModule.forRoot({
          ...fromRoot.reducers,
          products: combineReducers(fromProduct.reducers),
          cart: combineReducers(fromCart.reducers),
          user: combineReducers(fromUser.reducers)
        })
      ],
      declarations: [
        ProductListComponent,
        ProductPagingComponent,
        ProductFacetNavigationComponent,
        ProductGridItemComponent,
        ProductLineItemComponent,
        ProductListItemComponent,
        ProductSortingComponent,
        AddToCartComponent,
        PictureComponent
      ]
    }).compileComponents();
github intershop / intershop-pwa / src / app / extensions / quoting / store / quote-request / quote-request.selectors.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: ngrxTesting({
        reducers: {
          quoting: combineReducers(quotingReducers),
          shopping: combineReducers(shoppingReducers),
        },
      }),
    });

    store$ = TestBed.get(TestStore);
  });
github SAP / cloud-commerce-spartacus-storefront / projects / storefrontlib / src / lib / user / components / login / login-header-slot / login-header-slot.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        MaterialModule,
        BrowserAnimationsModule,
        FormsModule,
        StoreModule.forRoot({
          ...fromStore.reducers,
          user: combineReducers(fromStore.reducers)
        })
      ],
      declarations: [LoginHeaderSlotComponent]
    }).compileComponents();
  }));