Update some rce unit tests
closes MAT-507 flag=none test plan: passes jenkins Change-Id: Ibd76101c4a7a75c5656a70a03b46afa25e86fdcc Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277430 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Weston Dransfield <wdransfield@instructure.com> Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com> QA-Review: Jon Scheiding <jon.scheiding@instructure.com> Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
This commit is contained in:
parent
a2b5634d3d
commit
5c6cae1d3f
|
@ -1232,6 +1232,18 @@ describe('RCEWrapper', () => {
|
|||
assert.deepStrictEqual(mergePlugins(a, b), result)
|
||||
})
|
||||
})
|
||||
|
||||
describe('configures menus', () => {
|
||||
it('includes instructure_media in plugins if not instRecordDisabled', () => {
|
||||
const instance = createBasicElement({instRecordDisabled: false})
|
||||
assert.ok(instance.tinymceInitOptions.plugins.includes('instructure_record'))
|
||||
})
|
||||
|
||||
it('removes instructure_media from plugins if instRecordDisabled is set', () => {
|
||||
const instance = createBasicElement({instRecordDisabled: true})
|
||||
assert.ok(!instance.tinymceInitOptions.plugins.includes('instructure_record'))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('lti tool favorites', () => {
|
||||
|
|
|
@ -42,11 +42,6 @@ describe('Rce normalizeProps', () => {
|
|||
assert.equal(normalized.tinymce, tinymce)
|
||||
})
|
||||
|
||||
it('normalizes the language', () => {
|
||||
const normalized = normalizeProps({...props, language: 'mi-NZ'}, tinymce, MockMutationObserver)
|
||||
assert.equal(normalized.language, 'mi')
|
||||
})
|
||||
|
||||
it('retains other props', () => {
|
||||
const normalized = normalizeProps(
|
||||
{...props, textareaId: 'textareaId'},
|
||||
|
@ -55,26 +50,4 @@ describe('Rce normalizeProps', () => {
|
|||
)
|
||||
assert.equal(normalized.textareaId, 'textareaId')
|
||||
})
|
||||
|
||||
describe('configureMenus', () => {
|
||||
it('places instructure_media in menubar if not instRecordDisabled', () => {
|
||||
props = {...props, instRecordDisabled: false}
|
||||
const normalized = normalizeProps(props, tinymce, MockMutationObserver)
|
||||
assert.strictEqual(normalized.editorOptions.menubar, 'edit view insert format tools table')
|
||||
assert.strictEqual(
|
||||
normalized.editorOptions.menu.insert.items,
|
||||
'instructure_links instructure_image instructure_media instructure_document | instructure_equation inserttable instructure_media_embed | hr'
|
||||
)
|
||||
})
|
||||
|
||||
it('instructure_media not in menubar if instRecordDisabled is set', () => {
|
||||
props = {...props, instRecordDisabled: true}
|
||||
const normalized = normalizeProps(props, tinymce, MockMutationObserver)
|
||||
assert.strictEqual(normalized.editorOptions.menubar, 'edit view insert format tools table')
|
||||
assert.strictEqual(
|
||||
normalized.editorOptions.menu.insert.items,
|
||||
'instructure_links instructure_image instructure_document | instructure_equation inserttable instructure_media_embed | hr'
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue