|
3 | 3 | setCursor, openManuscriptEditor, PseudoFileEvent, getEditorSession, |
4 | 4 | loadBodyFixture, getDocument, setSelection, LOREM_IPSUM, |
5 | 5 | openContextMenuAndFindTool, openMenuAndFindTool, clickUndo, |
6 | | - isToolEnabled, createKeyEvent, selectNode, getSelection, getSelectionState |
| 6 | + isToolEnabled, createKeyEvent, selectNode, getSelection, |
| 7 | + getCurrentViewName |
7 | 8 | } from './shared/integrationTestHelpers' |
8 | 9 | import setupTestApp from './shared/setupTestApp' |
9 | 10 | import { doesNotThrowInNodejs } from './shared/testHelpers' |
@@ -451,14 +452,13 @@ function testCustomSelectionEditTool (t, spec) { |
451 | 452 | const _canEdit = () => isToolEnabled(editor, 'context-tools', spec.editToolSelector) |
452 | 453 | const _edit = () => openMenuAndFindTool(editor, 'context-tools', spec.editToolSelector).click() |
453 | 454 |
|
| 455 | + t.equal(getCurrentViewName(editor), 'manuscript', `should be in manuscript view`) |
454 | 456 | t.notOk(_canEdit(), 'edit author should be disabled wihtout selection') |
455 | 457 | getFirstItem().el.click() |
456 | 458 | t.ok(_canEdit(), 'edit author should be enabled') |
457 | 459 | _edit() |
458 | 460 |
|
459 | | - const selState = getSelectionState(editor) |
460 | | - const xpath = selState.xpath.map(i => i.type) |
461 | | - t.ok(xpath.indexOf(spec.metadataType) > -1, `selected property should be inside ${spec.metadataType}`) |
| 461 | + t.equal(getCurrentViewName(editor), 'metadata', `should be in metadata view now`) |
462 | 462 | t.end() |
463 | 463 | } |
464 | 464 |
|
|
0 commit comments