Skip to content
Snippets Groups Projects
Commit ac27c152 authored by fsdavid's avatar fsdavid
Browse files

Add e2e tests for region menu title

parent e4ccb7d1
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,17 @@ const dict = {
}
]
}
},
"Big Brain (Histology)": {
"Cytoarchitectonic Maps": {
tests:[
{
position: [440,200],
expectedLabelName: 'Area hOc1 (V1, 17, CalcS)',
expectedLabelStatus: '(fully mapped)'
}
]
}
}
}
......@@ -41,6 +52,28 @@ describe('> viewerCtxMenu', () => {
expect(visible).toBeTrue()
})
it('> Title includes region status', async () => {
const { tests } = dict[templateName][parcellationName]
const { expectedLabelStatus, expectedLabelName } = tests[0]
await iavPage.wait(500)
if (expectedLabelStatus) {
const fullMenuText = await iavPage.getText(`[aria-label="${ARIA_LABELS.CONTEXT_MENU}"]`)
const titleStatusText = await fullMenuText.substr(0, fullMenuText.indexOf('Brain region'))
expect(titleStatusText.trim()).toEqual(`${expectedLabelName} ${expectedLabelStatus}`)
}
})
it('> Title do not includes region status', async () => {
const { tests } = dict[templateName][parcellationName]
const { expectedLabelStatus, expectedLabelName } = tests[0]
await iavPage.wait(500)
if (!expectedLabelStatus) {
const fullMenuText = await iavPage.getText(`[aria-label="${ARIA_LABELS.CONTEXT_MENU}"]`)
const titleStatusText = await fullMenuText.substr(0, fullMenuText.indexOf('Brain region'))
expect(titleStatusText.trim()).toEqual(expectedLabelName)
}
})
it('> pos does not change when click inside', async () => {
const { x: xBefore, y: yBefore, height: hBefore } = await iavPage.isAt(`[aria-label="${ARIA_LABELS.CONTEXT_MENU}"]`)
await iavPage.click(`[aria-label="${ARIA_LABELS.SHOW_IN_OTHER_REF_SPACE}"]`)
......
......@@ -2,7 +2,7 @@
<mat-card-title>
<div class="position-relative region-name">
{{ region.name }}
<small *ngIf="region.status">({{region.status}})</small>
<small *ngIf="region.status"> ({{region.status}})</small>
</div>
</mat-card-title>
<mat-card-subtitle>
......
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