const sTestPaste = function (editor, tinyApis) {
return Log.stepsAsStep('TBA', 'Paste: Paste external content', [
sPaste(editor, tinyApis, '<p>abc</p>', { 'text/plain': 'X', 'text/html': '<p>X</p>' }, [0, 0], 0, [0, 0], 3),
sWaitForProcessEvents,
sAssertLastPreProcessEvent({ internal: false, content: 'X' }),
sAssertLastPostProcessEvent({ internal: false, content: 'X' })
]),
Log.stepsAsStep('TBA', 'Paste: Paste external content treated as plain text', [
sPaste(editor, tinyApis, '<p>abc</p>', { 'text/html': '<p>X</p>' }, [0, 0], 0, [0, 0], 3),
sWaitForProcessEvents,
sAssertLastPreProcessEvent({ internal: false, content: 'X' }),
sAssertLastPostProcessEvent({ internal: false, content: 'X' })
]),
Log.stepsAsStep('TBA', 'Paste: Paste internal content with mark', [
sPaste(editor, tinyApis, '<p>abc</p>', { 'text/plain': 'X', 'text/html': InternalHtml.mark('<p>X</p>') }, [0, 0], 0, [0, 0], 3),
sWaitForProcessEvents,
sAssertLastPreProcessEvent({ internal: true, content: '<p>X</p>' }),
sAssertLastPostProcessEvent({ internal: true, content: '<p>X</p>' })
]),
Log.stepsAsStep('TBA', 'Paste: Paste internal content with mime', [
sPaste(editor, tinyApis, '<p>abc</p>',
{ 'text/plain': 'X', 'text/html': '<p>X</p>', 'x-tinymce/html': '<p>X</p>' },
[0, 0], 0, [0, 0], 3
),
sWaitForProcessEvents,
sAssertLastPreProcessEvent({ internal: true, content: '<p>X</p>' }),
sAssertLastPostProcessEvent({ internal: true, content: '<p>X</p>' })
]);
};
请发表评论