mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
150 Backup commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { CommunityGridElementComponent } from './community-grid-element.component';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { RouterStub } from '../../testing/router-stub';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ListableObject } from '../../object-collection/shared/listable-object.model';
|
||||
import { Community } from '../../../core/shared/community.model';
|
||||
|
||||
let communityGridElementComponent: CommunityGridElementComponent;
|
||||
let fixture: ComponentFixture<CommunityGridElementComponent>;
|
||||
const queryParam = 'test query';
|
||||
const scopeParam = '7669c72a-3f2a-451f-a3b9-9210e7a4c02f';
|
||||
const activatedRouteStub = {
|
||||
queryParams: Observable.of({
|
||||
query: queryParam,
|
||||
scope: scopeParam
|
||||
})
|
||||
};
|
||||
describe('CommunityGridElementComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CommunityGridElementComponent ],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
||||
{ provide: Router, useClass: RouterStub },
|
||||
{ provide: 'objectElementProvider', useFactory: (communityGridElementComponent)}
|
||||
],
|
||||
|
||||
schemas: [ NO_ERRORS_SCHEMA ]
|
||||
}).compileComponents(); // compile template and css
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(CommunityGridElementComponent);
|
||||
communityGridElementComponent = fixture.componentInstance;
|
||||
|
||||
}));
|
||||
|
||||
it('should show the community cards in the grid element',()=>{
|
||||
expect(fixture.debugElement.query(By.css('ds-community-grid-element'))).toBeDefined();
|
||||
})
|
||||
});
|
Reference in New Issue
Block a user