Skip to content
Snippets Groups Projects
Unverified Commit 191e3e7c authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #65 from FZJ-INM1-BDA/bugfix/templateDesc

Fixing desc of templates
parents 560e09c0 0ef8380c
No related branches found
No related tags found
No related merge requests found
......@@ -31,4 +31,20 @@ describe('selecting template', () => {
const viewerIsPopulated = await iavPage.viewerIsPopulated()
expect(viewerIsPopulated).toBe(true)
})
it('MNI152 should return desc', async () => {
const expectedDesc = `An unbiased non-linear average of multiple subjects from the MNI152 database, which provides high-spatial resolution and signal-to-noise while not being biased towards a single brain (Fonov et al., 2011). This template space is widely used as a reference space in neuroimaging. HBP provides the JuBrain probabilistic cytoarchitectonic atlas (Amunts/Zilles, 2015) as well as a probabilistic atlas of large fibre bundles (Guevara, Mangin et al., 2017) in this space.`
await iavPage.goto()
await iavPage.selectTitleCard('ICBM 2009c Nonlinear Asymmetric')
await iavPage.wait(1000)
const info = await iavPage.getTemplateInfo()
expect(
info.indexOf(expectedDesc)
).toBeGreaterThanOrEqual(0)
})
})
......@@ -210,6 +210,28 @@ class WdLayoutPage extends WdBase{
// Will throw if status panel is not visible
return this._getStatusPanel().click()
}
// will throw if sidenav is not visible
async getTemplateInfo(){
const ariaText = `Hover to find out more info on the selected template`
const infoBtn = await this._getSideNav()
.findElement( By.css(`[aria-label="${ariaText}"]`) )
await this._driver.actions()
.move()
.move({
origin: infoBtn,
duration: 1000
})
.perform()
await this.wait(500)
const text = await this._getSideNav()
.findElement( By.id('selected-template-detailed-info') )
.getText()
return text
}
}
class WdIavPage extends WdLayoutPage{
......
......@@ -32,7 +32,7 @@ export class MarkdownDom implements AfterViewChecked {
this.innerHtml = this.converter.makeHtml(
this.getMarkdown()
)
this.cdr.markForCheck()
this.cdr.detectChanges()
}
@ViewChild('ngContentWrapper', {read : ElementRef, static: true})
......
describe('singleDataset.component.ts', () => {
describe('', () => {
})
})
\ No newline at end of file
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Optional} from "@angular/core";
import {
AtlasViewerConstantsServices,
DatabrowserService,
KgSingleDatasetService,
SingleDatasetBase,
......@@ -22,11 +21,10 @@ export class SingleDatasetView extends SingleDatasetBase {
dbService: DatabrowserService,
singleDatasetService: KgSingleDatasetService,
cdr: ChangeDetectorRef,
constantService: AtlasViewerConstantsServices,
@Optional() @Inject(MAT_DIALOG_DATA) data: any,
) {
super(dbService, singleDatasetService, cdr, constantService, data)
super(dbService, singleDatasetService, cdr, data)
}
}
......@@ -2,7 +2,6 @@ import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from "@angular/
SingleDatasetBase,
DatabrowserService,
KgSingleDatasetService,
AtlasViewerConstantsServices,
} from "../singleDataset.base";
import { SingleDatasetView } from "../detailedView/singleDataset.component";
import {MatDialog} from "@angular/material/dialog";
......@@ -23,11 +22,10 @@ export class SingleDatasetListView extends SingleDatasetBase {
private _dbService: DatabrowserService,
singleDatasetService: KgSingleDatasetService,
cdr: ChangeDetectorRef,
constantService: AtlasViewerConstantsServices,
private dialog: MatDialog,
private snackBar: MatSnackBar,
) {
super(_dbService, singleDatasetService, cdr, constantService)
super(_dbService, singleDatasetService, cdr)
}
public showDetailInfo() {
......
import { SingleDatasetView } from './detailedView/singleDataset.component'
import { TestBed, async } from '@angular/core/testing';
import { AngularMaterialModule } from 'src/ui/sharedModules/angularMaterial.module';
import { DatabrowserModule } from '../databrowser.module';
import { ComponentsModule } from 'src/components/components.module';
import { DatabrowserService, KgSingleDatasetService } from './singleDataset.base';
import { provideMockStore } from '@ngrx/store/testing';
import { defaultRootState } from 'src/services/stateStore.service';
import { HttpClientModule } from '@angular/common/http';
describe('singleDataset.base.ts', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
AngularMaterialModule,
DatabrowserModule,
ComponentsModule,
HttpClientModule
],
providers: [
DatabrowserService,
KgSingleDatasetService,
provideMockStore({
initialState: defaultRootState
})
]
}).compileComponents()
}))
describe('SingleDatasetBase', () => {
it('on init, component is truthy', () => {
const fixture = TestBed.createComponent(SingleDatasetView)
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
})
})
})
import { ChangeDetectorRef, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from "@angular/core";
import { ChangeDetectorRef, Input, OnInit, TemplateRef } from "@angular/core";
import { Observable } from "rxjs";
import { AtlasViewerConstantsServices } from "src/atlasViewer/atlasViewer.constantService.service";
import { IDataEntry, IFile, IPublication, ViewerPreviewFile } from 'src/services/state/dataStore.store'
......@@ -12,7 +12,7 @@ export {
DatabrowserService,
KgSingleDatasetService,
ChangeDetectorRef,
AtlasViewerConstantsServices,
AtlasViewerConstantsServices
}
export class SingleDatasetBase implements OnInit {
......@@ -59,8 +59,6 @@ export class SingleDatasetBase implements OnInit {
private dbService: DatabrowserService,
private singleDatasetService: KgSingleDatasetService,
private cdr: ChangeDetectorRef,
private constantService: AtlasViewerConstantsServices,
dataset?: any,
) {
......
......@@ -54,6 +54,7 @@
<mat-card *ngFor="let originDataset of moreInfo.originDatasets"
class="position-absolute left-0 top-0 w-40em">
<single-dataset-view
id="selected-template-detailed-info"
[name]="moreInfo.name"
[description]="moreInfo.description"
[publications]="moreInfo.publications"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment