mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
[CST-5339] Tests (WIP)
This commit is contained in:
@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { OrcidQueueService } from '../../../core/orcid/orcid-queue.service';
|
import { OrcidQueueService } from '../../../core/orcid/orcid-queue.service';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||||
@@ -16,10 +16,13 @@ import { OrcidQueue } from '../../../core/orcid/model/orcid-queue.model';
|
|||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
|
||||||
fdescribe('OrcidQueueComponent test suite', () => {
|
fdescribe('OrcidQueueComponent test suite', () => {
|
||||||
let comp: OrcidQueueComponent;
|
let component: OrcidQueueComponent;
|
||||||
let fixture: ComponentFixture<OrcidQueueComponent>;
|
let fixture: ComponentFixture<OrcidQueueComponent>;
|
||||||
|
let debugElement: DebugElement;
|
||||||
let orcidQueueService: OrcidQueueService;
|
let orcidQueueService: OrcidQueueService;
|
||||||
|
|
||||||
const testOwnerId = 'test-owner-id';
|
const testOwnerId = 'test-owner-id';
|
||||||
@@ -76,14 +79,20 @@ fdescribe('OrcidQueueComponent test suite', () => {
|
|||||||
orcidQueueService = TestBed.inject(OrcidQueueService);
|
orcidQueueService = TestBed.inject(OrcidQueueService);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(OrcidQueueComponent);
|
fixture = TestBed.createComponent(OrcidQueueComponent);
|
||||||
comp = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
debugElement = fixture.debugElement;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(comp).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should ...', () => {
|
||||||
|
const table = debugElement.queryAll(By.css('table'));
|
||||||
|
expect(table.length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user