提交 01c6e117 authored 作者: 王鹏飞's avatar 王鹏飞

test(admin): cover all editor node serializers

上级 40d98862
......@@ -11,6 +11,13 @@ const fixtures = {
chapterGallery: { type: 'chapterGallery', title: 'Gallery title', galleryList, random: 'gallery-1', flex: 1, theme: '#123456', children: [{ text: '' }] },
chapterGalleryInline: { type: 'chapterGalleryInline', title: 'Inline gallery', galleryList, random: 'gallery-2', flex: 1, theme: '#123456', fontsize: 18, children: [{ text: '' }] },
chapterFormula: { type: 'chapterFormula', formulaHtml: '<svg><text>x</text></svg>', children: [{ text: '' }] },
chapterSection: { type: 'chapterSection', title: 'Section', bgColor: '#123456', textColor: '#ffffff', random: 'section-1', align: 'center', height: 100, size: 20, family: 'Arial', children: [{ text: '' }] },
chapterHeader: { type: 'chapterHeader', title: 'Header', bgImgUrl: 'https://example.test/header.png', textColor: '#ffffff', random: 'header-1', align: 'left', bgColor: '#123456', size: 26, family: 'Arial', children: [{ text: '' }] },
chapterPractice: { type: 'chapterPractice', title: 'Practice', practiceNum: 'practice-1', bookId: 'book-1', chapterId: 'chapter-1', theme: '#123456', children: [{ text: '' }] },
chapterTooltip: { type: 'chapterTooltip', title: 'Tooltip', tooltipType: 1, content: 'Tooltip content', link: 'https://example.test', random: 'tooltip-1', theme: '#123456', fontsize: 18, children: [{ text: '' }] },
chapterLink: { type: 'chapterLink', title: 'Link', linktype: 1, link: 'https://example.test', chapters: 'chapter-1', random: 'link-1', theme: '#123456', fontsize: 18, children: [{ text: '' }] },
chapterExpandRead: { type: 'chapterExpandRead', title: 'Expand', name: 'Source', random: 'expand-1', flex: 1, theme: '#123456', children: [{ text: '' }] },
chapterExpandReadSimple: { type: 'chapterExpandReadSimple', title: 'Expand simple', name: 'Source', random: 'expand-2', flex: 1, theme: '#123456', fontsize: 18, children: [{ text: '' }] },
}
const expectedFields = {
......@@ -20,6 +27,13 @@ const expectedFields = {
chapterGallery: ['title', 'galleryList', 'random', 'flex'],
chapterGalleryInline: ['title', 'galleryList', 'random', 'flex', 'theme', 'fontsize'],
chapterFormula: ['formulaHtml'],
chapterSection: ['title', 'bgColor', 'textColor', 'random', 'align', 'height', 'size', 'family'],
chapterHeader: ['title', 'bgImgUrl', 'textColor', 'random', 'align', 'bgColor', 'size', 'family'],
chapterPractice: ['title', 'practiceNum', 'bookId', 'chapterId', 'theme'],
chapterTooltip: ['title', 'tooltipType', 'content', 'link', 'random', 'theme', 'fontsize'],
chapterLink: ['title', 'linktype', 'link', 'chapters', 'random', 'theme', 'fontsize'],
chapterExpandRead: ['title', 'name', 'random', 'flex', 'theme'],
chapterExpandReadSimple: ['title', 'name', 'random', 'flex', 'theme', 'fontsize'],
}
const configFor = type => {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论