mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
150 Backup commit
This commit is contained in:
@@ -4,7 +4,7 @@ import { element } from 'protractor';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Config } from '../../../config/config.interface';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { RouterStub } from '../testing/router-stub';
|
||||
@@ -12,6 +12,7 @@ import { RouterStub } from '../testing/router-stub';
|
||||
describe('ObjectCollectionComponent', () => {
|
||||
let fixture: ComponentFixture<ObjectCollectionComponent>;
|
||||
let objectCollectionComponent: ObjectCollectionComponent;
|
||||
|
||||
const queryParam = 'test query';
|
||||
const scopeParam = '7669c72a-3f2a-451f-a3b9-9210e7a4c02f';
|
||||
const activatedRouteStub = {
|
||||
@@ -34,19 +35,21 @@ describe('ObjectCollectionComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(ObjectCollectionComponent);
|
||||
objectCollectionComponent = fixture.componentInstance;
|
||||
|
||||
}));
|
||||
it('should only show the grid component when the viewmode is set to grid', () => {
|
||||
objectCollectionComponent.currentMode = ViewMode.Grid;
|
||||
|
||||
// expect(By.css('ds-object-grid')).toEqual(1);
|
||||
// expect(By.css('ds-object-list')).toEqual(0);
|
||||
|
||||
expect(fixture.debugElement.query(By.css('ds-object-grid'))).toBeDefined();
|
||||
expect(fixture.debugElement.query(By.css('ds-object-list'))).toBeNull();
|
||||
});
|
||||
|
||||
it('should only show the list component when the viewmode is set to list', () => {
|
||||
objectCollectionComponent.currentMode = ViewMode.List;
|
||||
|
||||
// expect(By.css('ds-object-list').length).toEqual(1);
|
||||
// expect(By.css('ds-object-grid').length).toEqual(0);
|
||||
expect(fixture.debugElement.query(By.css('ds-object-list'))).toBeDefined();
|
||||
expect(fixture.debugElement.query(By.css('ds-object-grid'))).toBeNull();
|
||||
})
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user