Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}));
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);
});
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
StoreModule.forRoot({
products: combineReducers(fromProduct.reducers),
})
],
declarations: [ BestSellersContainer ]
})
.compileComponents();
}));
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);
});
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,
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),
],
});
});
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
StoreModule.forRoot({
...fromRoot.reducers,
products: combineReducers(fromStore.reducers)
})
],
providers: [ProductGuard]
});
productGuard = TestBed.get(ProductGuard);
store = TestBed.get(Store);
});
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();
beforeEach(() => {
TestBed.configureTestingModule({
imports: ngrxTesting({
reducers: {
quoting: combineReducers(quotingReducers),
shopping: combineReducers(shoppingReducers),
},
}),
});
store$ = TestBed.get(TestStore);
});
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MaterialModule,
BrowserAnimationsModule,
FormsModule,
StoreModule.forRoot({
...fromStore.reducers,
user: combineReducers(fromStore.reducers)
})
],
declarations: [LoginHeaderSlotComponent]
}).compileComponents();
}));