Commits

lotte authored aa5383ca5a7
remove unnecessary async that causes test timeout
No tags

src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.spec.ts

Modified
6 6 import { Item } from '../../../../core/shared/item.model';
7 7 import { TooltipModule } from 'ngx-bootstrap';
8 8 import { MetadataValue } from '../../../../core/shared/metadata.models';
9 9
10 10 const description = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.';
11 11 const organisation = 'Anonymous';
12 12 const mockItem = Object.assign(new Item(), { metadata: { 'dc.description': [{ value: description }], 'organization.legalName': [{ value: organisation }] } });
13 13 const virtMD = Object.assign(new MetadataValue(), { value: organisation });
14 14 const mockItemMetadataRepresentation = Object.assign(new ItemMetadataRepresentation(virtMD), mockItem);
15 15
16 -describe('OrgUnitItemMetadataListElementComponent', () => {
16 +fdescribe('OrgUnitItemMetadataListElementComponent', () => {
17 17 let comp: OrgUnitItemMetadataListElementComponent;
18 18 let fixture: ComponentFixture<OrgUnitItemMetadataListElementComponent>;
19 19
20 20 beforeEach(async(() => {
21 21 TestBed.configureTestingModule({
22 22 imports: [TooltipModule.forRoot()],
23 23 declarations: [OrgUnitItemMetadataListElementComponent],
24 24 schemas: [NO_ERRORS_SCHEMA]
25 25 }).overrideComponent(OrgUnitItemMetadataListElementComponent, {
26 26 set: { changeDetection: ChangeDetectionStrategy.Default }
27 27 }).compileComponents();
28 28 }));
29 29
30 - beforeEach(async(() => {
30 + beforeEach(() => {
31 31 fixture = TestBed.createComponent(OrgUnitItemMetadataListElementComponent);
32 32 comp = fixture.componentInstance;
33 33 comp.metadataRepresentation = mockItemMetadataRepresentation;
34 34 fixture.detectChanges();
35 - }));
35 + });
36 36
37 37 it('should show the name of the organisation as a link', () => {
38 38 const linkText = fixture.debugElement.query(By.css('a')).nativeElement.textContent;
39 39 expect(linkText).toBe(organisation);
40 40 });
41 41
42 42 it('should show the description on hover over the link in a tooltip', () => {
43 43 const link = fixture.debugElement.query(By.css('a'));
44 44 link.triggerEventHandler('mouseover', null);
45 45 fixture.detectChanges();

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut