mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 19:13:08 +00:00
[DURACOM-191] run optimize imports and lint fix
This commit is contained in:
@@ -1,25 +1,37 @@
|
||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { of, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
cold,
|
||||
getTestScheduler,
|
||||
hot,
|
||||
} from 'jasmine-marbles';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import {
|
||||
of as observableOf,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
|
||||
import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
|
||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
||||
@@ -37,12 +49,10 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications-
|
||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
|
||||
import {
|
||||
BitstreamFormatsComponent,
|
||||
BitstreamFormatsComponent,
|
||||
} from './bitstream-formats.component';
|
||||
|
||||
describe('BitstreamFormatsComponent', () => {
|
||||
let comp: BitstreamFormatsComponent;
|
||||
@@ -108,7 +118,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
||||
findAll: observableOf(mockFormatsRD),
|
||||
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
||||
getSelectedBitstreamFormats: hot('a', {a: mockFormatsList}),
|
||||
getSelectedBitstreamFormats: hot('a', { a: mockFormatsList }),
|
||||
selectBitstreamFormat: {},
|
||||
deselectBitstreamFormat: {},
|
||||
deselectAllBitstreamFormats: {},
|
||||
@@ -124,7 +134,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
|
||||
|
||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
findByPropertyName: of({payload: {value: 'test'}}),
|
||||
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -134,12 +144,12 @@ describe('BitstreamFormatsComponent', () => {
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: GroupDataService, useValue: groupDataService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: GroupDataService, useValue: groupDataService },
|
||||
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
@@ -266,7 +276,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
});
|
||||
|
||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
findByPropertyName: of({payload: {value: 'test'}}),
|
||||
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -278,21 +288,21 @@ describe('BitstreamFormatsComponent', () => {
|
||||
BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: GroupDataService, useValue: groupDataService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: GroupDataService, useValue: groupDataService },
|
||||
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(BitstreamFormatsComponent, {
|
||||
remove: {imports: [PaginationComponent]},
|
||||
add: {imports: [TestPaginationComponent]}
|
||||
remove: { imports: [PaginationComponent] },
|
||||
add: { imports: [TestPaginationComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}
|
||||
},
|
||||
));
|
||||
|
||||
beforeEach(initBeforeEach);
|
||||
@@ -336,7 +346,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
});
|
||||
|
||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
findByPropertyName: of({payload: {value: 'test'}}),
|
||||
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -345,22 +355,22 @@ describe('BitstreamFormatsComponent', () => {
|
||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: GroupDataService, useValue: groupDataService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: GroupDataService, useValue: groupDataService },
|
||||
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(BitstreamFormatsComponent, {
|
||||
remove: {imports: [PaginationComponent]},
|
||||
add: {imports: [TestPaginationComponent]}
|
||||
remove: { imports: [PaginationComponent] },
|
||||
add: { imports: [TestPaginationComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}
|
||||
},
|
||||
));
|
||||
|
||||
beforeEach(initBeforeEach);
|
||||
|
Reference in New Issue
Block a user