Skip to content

Commit f8deaf0

Browse files
Daniel BeilinsonDaniel Beilinson
authored andcommitted
Inspect viewname after applying edit tool.
1 parent b923c19 commit f8deaf0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/ManuscriptEditor.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
setCursor, openManuscriptEditor, PseudoFileEvent, getEditorSession,
44
loadBodyFixture, getDocument, setSelection, LOREM_IPSUM,
55
openContextMenuAndFindTool, openMenuAndFindTool, clickUndo,
6-
isToolEnabled, createKeyEvent, selectNode, getSelection, getSelectionState
6+
isToolEnabled, createKeyEvent, selectNode, getSelection,
7+
getCurrentViewName
78
} from './shared/integrationTestHelpers'
89
import setupTestApp from './shared/setupTestApp'
910
import { doesNotThrowInNodejs } from './shared/testHelpers'
@@ -451,14 +452,13 @@ function testCustomSelectionEditTool (t, spec) {
451452
const _canEdit = () => isToolEnabled(editor, 'context-tools', spec.editToolSelector)
452453
const _edit = () => openMenuAndFindTool(editor, 'context-tools', spec.editToolSelector).click()
453454

455+
t.equal(getCurrentViewName(editor), 'manuscript', `should be in manuscript view`)
454456
t.notOk(_canEdit(), 'edit author should be disabled wihtout selection')
455457
getFirstItem().el.click()
456458
t.ok(_canEdit(), 'edit author should be enabled')
457459
_edit()
458460

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`)
462462
t.end()
463463
}
464464

0 commit comments

Comments
 (0)