Skip to content

Commit 576d95f

Browse files
[DSC-1868] Removed old mock classes + fixed imports
1 parent bc49e77 commit 576d95f

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { EntityDropdownComponent } from './entity-dropdown.component';
33
import { getTestScheduler } from 'jasmine-marbles';
44
import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
55
import { ItemType } from '../../core/shared/item-relationships/item-type.model';
6-
import { ChangeDetectorRef, NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core';
6+
import { ChangeDetectorRef, NO_ERRORS_SCHEMA } from '@angular/core';
77
import { EntityTypeDataService } from '../../core/data/entity-type-data.service';
88
import { TestScheduler } from 'rxjs/testing';
99
import { By } from '@angular/platform-browser';
@@ -12,21 +12,7 @@ import { ItemExportFormatService } from '../../core/itemexportformat/item-export
1212
import { of } from 'rxjs/internal/observable/of';
1313
import { ItemExportFormat, ItemExportFormatMap } from '../../core/itemexportformat/model/item-export-format.model';
1414
import { TranslateService } from '@ngx-translate/core';
15-
16-
// eslint-disable-next-line @angular-eslint/pipe-prefix
17-
@Pipe({ name: 'translate' })
18-
class MockTranslatePipe implements PipeTransform {
19-
transform(value: string): string {
20-
return value;
21-
}
22-
}
23-
24-
@Pipe({ name: 'dsSort' })
25-
class MockDsSortPipe implements PipeTransform {
26-
transform(value: any[], column: string = '', order: 'asc' | 'desc' = 'asc'): any[] {
27-
return value;
28-
}
29-
}
15+
import { SortPipe } from '../utils/sort.pipe';
3016

3117
const entities: ItemType[] = [
3218
Object.assign(new ItemType(), {
@@ -105,15 +91,13 @@ describe('EntityDropdownComponent', () => {
10591
}
10692
};
10793

108-
let translatePipeSpy: jasmine.Spy;
109-
11094
const paginatedEntities = createPaginatedList(entities);
11195
const paginatedEntitiesRD$ = createSuccessfulRemoteDataObject$(paginatedEntities);
11296

11397
beforeEach(waitForAsync(() => {
11498
TestBed.configureTestingModule({
11599
imports: [],
116-
declarations: [EntityDropdownComponent, MockTranslatePipe, MockDsSortPipe],
100+
declarations: [EntityDropdownComponent, SortPipe],
117101
providers: [
118102
{ provide: EntityTypeDataService, useValue: entityTypeServiceMock },
119103
{ provide: ItemExportFormatService, useValue: itemExportFormatServiceMock },
@@ -134,8 +118,6 @@ describe('EntityDropdownComponent', () => {
134118
componentAsAny.entityTypeService.getAllAuthorizedRelationshipTypeImport.and.returnValue(paginatedEntitiesRD$);
135119
componentAsAny.itemExportFormatService.byEntityTypeAndMolteplicity.and.returnValue(of(entityFormatList));
136120
component.isSubmission = true;
137-
138-
translatePipeSpy = spyOn(MockTranslatePipe.prototype, 'transform');
139121
});
140122

141123
it('should init component with entities list', () => {

0 commit comments

Comments
 (0)