-
Notifications
You must be signed in to change notification settings - Fork 6
/
collection-page.component.spec.ts
executable file
·56 lines (48 loc) · 1.83 KB
/
collection-page.component.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { MatCardModule, MatInputModule } from '@angular/material';
import { HttpClientModule } from '@angular/common/http';
import { NgxsModule, Store } from '@ngxs/store';
import { CoreModule } from '../../core/core.module';
import { CollectionPageComponent } from './collection-page.component';
import { BookPreviewListComponent } from '../components/book-preview-list.component';
import { BookPreviewComponent } from '../components/book-preview.component';
import { EllipsisPipe } from '../../shared/pipes/ellipsis.pipe';
import { AddCommasPipe } from '../../shared/pipes/add-commas.pipe';
import { BookAuthorsComponent } from '../components/book-authors.component';
import { BooksStates } from '../store';
describe('Collection Page', () => {
let fixture: ComponentFixture<CollectionPageComponent>;
let store: Store;
let instance: CollectionPageComponent;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
CoreModule.forRoot(),
HttpClientModule,
NoopAnimationsModule,
NgxsModule.forRoot(BooksStates),
MatCardModule,
MatInputModule,
RouterTestingModule,
],
declarations: [
CollectionPageComponent,
BookPreviewListComponent,
BookPreviewComponent,
BookAuthorsComponent,
AddCommasPipe,
EllipsisPipe,
],
});
fixture = TestBed.createComponent(CollectionPageComponent);
instance = fixture.componentInstance;
store = TestBed.get(Store);
spyOn(store, 'dispatch').and.callThrough();
});
it('should compile', () => {
fixture.detectChanges();
expect(fixture).toMatchSnapshot();
});
});