browse-by.component.spec.ts (dspace-angular-dspace-7.0) | : | browse-by.component.spec.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; | import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; | |||
import { RouterTestingModule } from '@angular/router/testing'; | import { RouterTestingModule } from '@angular/router/testing'; | |||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |||
import { PaginationComponentOptions } from '../pagination/pagination-component-o ptions.model'; | import { PaginationComponentOptions } from '../pagination/pagination-component-o ptions.model'; | |||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options .model'; | import { SortDirection, SortOptions } from '../../core/cache/models/sort-options .model'; | |||
import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; | import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; | |||
import { storeModuleConfig } from '../../app.reducer'; | import { storeModuleConfig } from '../../app.reducer'; | |||
import { FindListOptions } from '../../core/data/request.models'; | import { FindListOptions } from '../../core/data/request.models'; | |||
import { PaginationService } from '../../core/pagination/pagination.service'; | import { PaginationService } from '../../core/pagination/pagination.service'; | |||
import { PaginationServiceStub } from '../testing/pagination-service.stub'; | import { PaginationServiceStub } from '../testing/pagination-service.stub'; | |||
import { ThemeService } from '../theme-support/theme.service'; | ||||
describe('BrowseByComponent', () => { | describe('BrowseByComponent', () => { | |||
let comp: BrowseByComponent; | let comp: BrowseByComponent; | |||
let fixture: ComponentFixture<BrowseByComponent>; | let fixture: ComponentFixture<BrowseByComponent>; | |||
let themeService: ThemeService; | ||||
const mockItems = [ | const mockItems = [ | |||
Object.assign(new Item(), { | Object.assign(new Item(), { | |||
id: 'fakeId-1', | id: 'fakeId-1', | |||
metadata: [ | metadata: [ | |||
{ | { | |||
key: 'dc.title', | key: 'dc.title', | |||
value: 'First Fake Title' | value: 'First Fake Title' | |||
} | } | |||
] | ] | |||
}), | }), | |||
skipping to change at line 60 | skipping to change at line 63 | |||
const paginationConfig = Object.assign(new PaginationComponentOptions(), { | const paginationConfig = Object.assign(new PaginationComponentOptions(), { | |||
id: 'test-pagination', | id: 'test-pagination', | |||
currentPage: 1, | currentPage: 1, | |||
pageSizeOptions: [5, 10, 15, 20], | pageSizeOptions: [5, 10, 15, 20], | |||
pageSize: 15 | pageSize: 15 | |||
}); | }); | |||
const paginationService = new PaginationServiceStub(paginationConfig); | const paginationService = new PaginationServiceStub(paginationConfig); | |||
beforeEach(waitForAsync(() => { | beforeEach(waitForAsync(() => { | |||
themeService = jasmine.createSpyObj('themeService', { | ||||
getThemeName: 'dspace', | ||||
}); | ||||
TestBed.configureTestingModule({ | TestBed.configureTestingModule({ | |||
imports: [ | imports: [ | |||
CommonModule, | CommonModule, | |||
TranslateModule.forRoot(), | TranslateModule.forRoot(), | |||
SharedModule, | SharedModule, | |||
NgbModule, | NgbModule, | |||
StoreModule.forRoot({}, storeModuleConfig), | StoreModule.forRoot({}, storeModuleConfig), | |||
TranslateModule.forRoot({ | TranslateModule.forRoot({ | |||
loader: { | loader: { | |||
provide: TranslateLoader, | provide: TranslateLoader, | |||
useClass: TranslateLoaderMock | useClass: TranslateLoaderMock | |||
} | } | |||
}), | }), | |||
RouterTestingModule, | RouterTestingModule, | |||
BrowserAnimationsModule | BrowserAnimationsModule | |||
], | ], | |||
declarations: [], | declarations: [], | |||
providers: [ | providers: [ | |||
{provide: PaginationService, useValue: paginationService} | {provide: PaginationService, useValue: paginationService}, | |||
{ provide: ThemeService, useValue: themeService }, | ||||
], | ], | |||
schemas: [NO_ERRORS_SCHEMA] | schemas: [NO_ERRORS_SCHEMA] | |||
}).compileComponents(); | }).compileComponents(); | |||
})); | })); | |||
beforeEach(() => { | beforeEach(() => { | |||
fixture = TestBed.createComponent(BrowseByComponent); | fixture = TestBed.createComponent(BrowseByComponent); | |||
comp = fixture.componentInstance; | comp = fixture.componentInstance; | |||
}); | }); | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 8 lines changed or added |