本文整理汇总了TypeScript中@ephox/mcagar.LegacyUnit.equal方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LegacyUnit.equal方法的具体用法?TypeScript LegacyUnit.equal怎么用?TypeScript LegacyUnit.equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/mcagar.LegacyUnit
的用法示例。
在下文中一共展示了LegacyUnit.equal方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
suite.test('custom elements', function (editor) {
editor.setContent('<custom1>c1</custom1><custom2>c1</custom2>');
LegacyUnit.equal(editor.getContent(), '<custom1>c1</custom1><p><custom2>c1</custom2></p>');
});
示例2: function
const ok = function (a, label) {
LegacyUnit.equal(a, true, label);
};
示例3: function
suite.test('TestCase-TBA: LegacyOutput: Font face', function (editor) {
editor.setContent('<p>text</p>');
LegacyUnit.setSelection(editor, 'p', 0, 'p', 4);
editor.execCommand('fontname', false, 'times');
LegacyUnit.equal(editor.getContent(), '<p><font face="times">text</font></p>');
});
示例4: function
suite.test('create element index from bogus', function () {
setupHtml('<b></b><span data-mce-bogus="1"><b></b><span data-mce-bogus="1"><b></b><b></b></span></span>');
LegacyUnit.equal(CaretBookmark.create(getRoot(), CaretPosition.before(getRoot().lastChild.lastChild.childNodes[1])), 'b[3],before');
});
示例5: function
suite.test('isFakeCaretTarget', function () {
LegacyUnit.equal(false, isFakeCaretTarget(Element.fromHtml('<p></p>').dom()), 'Should not need a fake caret');
LegacyUnit.equal(true, isFakeCaretTarget(Element.fromHtml('<p contenteditable="false"></p>').dom()), 'Should always need a fake caret');
LegacyUnit.equal(isTableNavigationBrowser(), isFakeCaretTarget(Element.fromHtml('<table></table>').dom()), 'Should on some browsers need a fake caret');
});
示例6: function
suite.test('Compress styles', function () {
const styles = Styles();
LegacyUnit.equal(
styles.serialize(
styles.parse('border-top: 1px solid red; border-left: 1px solid red; border-bottom: 1px solid red; border-right: 1px solid red;')
),
'border: 1px solid red;'
);
LegacyUnit.equal(
styles.serialize(
styles.parse('border-width: 1pt 1pt 1pt 1pt; border-style: none none none none; border-color: black black black black;')
),
'border: 1pt none black;'
);
LegacyUnit.equal(
styles.serialize(
styles.parse('border-width: 1pt 4pt 2pt 3pt; border-style: solid dashed dotted none; border-color: black red green blue;')
),
'border-width: 1pt 4pt 2pt 3pt; border-style: solid dashed dotted none; border-color: black red green blue;'
);
LegacyUnit.equal(
styles.serialize(
styles.parse('border-top: 1px solid red; border-left: 1px solid red; border-right: 1px solid red; border-bottom: 1px solid red')
),
'border: 1px solid red;'
);
LegacyUnit.equal(
styles.serialize(
styles.parse('border-top: 1px solid red; border-right: 2px solid red; border-bottom: 3px solid red; border-left: 4px solid red')
),
'border-top: 1px solid red; border-right: 2px solid red; border-bottom: 3px solid red; border-left: 4px solid red;'
);
LegacyUnit.equal(
styles.serialize(
styles.parse('padding-top: 1px; padding-right: 2px; padding-bottom: 3px; padding-left: 4px')
),
'padding: 1px 2px 3px 4px;'
);
LegacyUnit.equal(
styles.serialize(styles.parse('margin-top: 1px; margin-right: 2px; margin-bottom: 3px; margin-left: 4px')),
'margin: 1px 2px 3px 4px;'
);
LegacyUnit.equal(
styles.serialize(styles.parse('margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 2px')),
'margin: 1px 1px 1px 2px;'
);
LegacyUnit.equal(
styles.serialize(styles.parse('margin-top: 2px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px')),
'margin: 2px 1px 1px 1px;'
);
LegacyUnit.equal(
styles.serialize(
styles.parse('border-top-color: red; border-right-color: green; border-bottom-color: blue; border-left-color: yellow')
),
'border-color: red green blue yellow;'
);
LegacyUnit.equal(
styles.serialize(styles.parse('border-width: 1px; border-style: solid; border-color: red')),
'border: 1px solid red;'
);
LegacyUnit.equal(
styles.serialize(styles.parse('border-width: 1px; border-color: red')),
'border-width: 1px; border-color: red;'
);
});
示例7: Promise
return new Promise(function (resolve) {
const pickerCtrl = getFilePickerCtrl(editor);
LegacyUnit.equal(pickerCtrl.value(), expectedValue, 'Should have the correct file picker value');
resolve(pickerCtrl);
});