本文整理汇总了TypeScript中@rich-editor/__tests__/OpUtils.op函数的典型用法代码示例。如果您正苦于以下问题:TypeScript op函数的具体用法?TypeScript op怎么用?TypeScript op使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
.forEach(({ op, name }) => {
const one = OpUtils.op("1");
const two = OpUtils.op("2");
const three = OpUtils.op("3");
const initial = [one, op, two, op, three, op];
it(`can apply the ${lineFormatName} format to the 1st line of 3 lines of the ${name} format`, () => {
const expected = [one, lineOp, two, op, three, op];
const range: RangeStatic = { index: 0, length: 0 };
const formatterFunction = () => format(range);
assertQuillInputOutput(initial, expected, formatterFunction);
});
it(`can apply the ${lineFormatName} format to the 2nd line of 3 lines of the ${name} format`, () => {
const expected = [one, op, two, lineOp, three, op];
const range: RangeStatic = { index: 2, length: 0 };
const formatterFunction = () => format(range);
assertQuillInputOutput(initial, expected, formatterFunction);
});
it(`can apply the ${lineFormatName} format to the 3rd line of 3 lines of the ${name} format`, () => {
const expected = [one, op, two, op, three, lineOp];
const range: RangeStatic = { index: 4, length: 0 };
const formatterFunction = () => format(range);
assertQuillInputOutput(initial, expected, formatterFunction);
});
});
开发者ID:vanilla,项目名称:vanilla,代码行数:27,代码来源:Formatter.test.ts
示例2: it
it("can have it's format replaced", () => {
insertListBlot({ type: ListType.BULLETED, depth: 0 }, "1");
insertListBlot({ type: ListType.BULLETED, depth: 1 }, "1.1");
insertListBlot({ type: ListType.BULLETED, depth: 1 }, "1.2");
quill.formatLine(0, 1, ListItem.blotName, false, Quill.sources.USER);
expect(quill.getContents().ops).deep.eq([
OpUtils.op("1\n1.1"),
OpUtils.list(ListType.BULLETED),
OpUtils.op("1.2"),
OpUtils.list(ListType.BULLETED),
]);
});
开发者ID:vanilla,项目名称:vanilla,代码行数:13,代码来源:ListBlot.test.ts
示例3: it
it("can paste it's own type of list blot", () => {
const ops = [
OpUtils.op("Line 1"),
OpUtils.list(ListType.BULLETED, 0),
OpUtils.op("Line 1.1"),
OpUtils.list(ListType.ORDERED, 1),
OpUtils.op("Line 1.1.1"),
OpUtils.list(ListType.BULLETED, 2),
OpUtils.op("Line 1.1.1.1"),
OpUtils.list(ListType.ORDERED, 3),
];
quill.setContents(ops);
const html = quill.scroll.domNode.innerHTML;
reset();
clipboard.dangerouslyPasteHTML(html);
expect(quill.getContents().ops).deep.eq(ops);
});
开发者ID:vanilla,项目名称:vanilla,代码行数:18,代码来源:ClipboardModule.test.ts
注:本文中的@rich-editor/__tests__/OpUtils.op函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论