#150 TSLint error fixing

This commit is contained in:
Jonas Van Goolen
2017-12-01 13:09:48 +01:00
parent 9b812100b1
commit 1f873acea4
12 changed files with 49 additions and 67 deletions

View File

@@ -6,8 +6,6 @@ import { RouterStub } from '../../testing/router-stub';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
import { Collection } from '../../../core/shared/collection.model';
let collectionGridElementComponent: CollectionGridElementComponent;
let fixture: ComponentFixture<CollectionGridElementComponent>;
const queryParam = 'test query';
const scopeParam = '7669c72a-3f2a-451f-a3b9-9210e7a4c02f';
@@ -17,7 +15,7 @@ const activatedRouteStub = {
scope: scopeParam
})
};
let mockCollection: Collection = Object.assign(new Collection(), {
const mockCollection: Collection = Object.assign(new Collection(), {
metadata: [
{
key: 'dc.description.abstract',
@@ -25,7 +23,7 @@ let mockCollection: Collection = Object.assign(new Collection(), {
value: 'Short description'
}]
});
let createdGridElementComponent:CollectionGridElementComponent= new CollectionGridElementComponent(mockCollection);
const createdGridElementComponent:CollectionGridElementComponent= new CollectionGridElementComponent(mockCollection);
describe('CollectionGridElementComponent', () => {
beforeEach(async(() => {
@@ -45,16 +43,16 @@ describe('CollectionGridElementComponent', () => {
fixture = TestBed.createComponent(CollectionGridElementComponent);
}));
it('should show the collection cards in the grid element',()=>{
it('should show the collection cards in the grid element',() => {
expect(fixture.debugElement.query(By.css('ds-collection-grid-element'))).toBeDefined();
});
it('should only show the description if "short description" metadata is present',()=>{
let descriptionText = expect(fixture.debugElement.query(By.css('p.card-text')));
it('should only show the description if "short description" metadata is present',() => {
const descriptionText = expect(fixture.debugElement.query(By.css('p.card-text')));
if(mockCollection.shortDescription.length>0){
if (mockCollection.shortDescription.length > 0) {
expect(descriptionText).toBeDefined();
}else{
}else {
expect(descriptionText).not.toBeDefined();
}
});

View File

@@ -5,7 +5,6 @@ import { renderElementsFor} from '../../object-collection/shared/dso-element-dec
import { ViewMode } from '../../../+search-page/search-options.model';
import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component';
@Component({
selector: 'ds-collection-grid-element',
styleUrls: ['./collection-grid-element.component.scss'],