refactor: note editor relationships (#1821)

This commit is contained in:
Mo
2022-10-18 08:59:24 -05:00
committed by GitHub
parent c83dc48d3f
commit 2b66ff82ee
28 changed files with 357 additions and 299 deletions

View File

@@ -356,14 +356,13 @@ describe('app models', () => {
})
it('maintains editor reference when duplicating note', async function () {
const note = await Factory.createMappedNote(this.application)
const editor = await this.application.itemManager.createItem(
ContentType.Component,
{ area: ComponentArea.Editor },
{ area: ComponentArea.Editor, package_info: { identifier: 'foo-editor' } },
true,
)
await this.application.itemManager.changeComponent(editor, (mutator) => {
mutator.associateWithItem(note.uuid)
const note = await Factory.insertItemWithOverride(this.application, ContentType.Note, {
editorIdentifier: 'foo-editor',
})
expect(this.application.componentManager.editorForNote(note).uuid).to.equal(editor.uuid)