import { Assertions } from '@ephox/agar'; import Protect from 'tinymce/plugins/fullpage/core/Protect'; import { UnitTest } from '@ephox/bedrock'; UnitTest.test('atomic.tinymce.plugins.fullpage.ProtectTest', function () { const testProtect = function () { Assertions.assertEq('', 'ac', Protect.protectHtml([/b/g], 'abc')); Assertions.assertEq('', 'acde', Protect.protectHtml([/b/g, /f/g], 'abcdef')); Assertions.assertEq('', 'ac', Protect.protectHtml([//g], 'ac')); }; const testUnprotect = function () { Assertions.assertEq('', 'abc', Protect.unprotectHtml('ac')); Assertions.assertEq('', 'abcdef', Protect.unprotectHtml('acde')); Assertions.assertEq('', 'ac', Protect.unprotectHtml('ac')); }; testProtect(); testUnprotect(); });