import { createLocalVue } from '@vue/test-utils' ; import CompositionApi from '@vue/composition-api' ; import { HeadingNode , ParagraphNode , Block , Mark , TextNode , TextType , MarkNode , StrongNode , UnderlineNode , ComponentNode , ComponentType , } from '@marvr/storyblok-rich-text-types' ; export function createVueInstance ( ) { const localVue = createLocalVue ( ) ; localVue . use ( CompositionApi ) ; return localVue ; } function createTextNode ( text , marks = [ ] ) { return { type : TextType , text , marks , } ; } export const headingNode = { type : Block . HEADING , attrs : { level : 1 , } , content : [ createTextNode ( 'Heading' ) ] , } ; export const paragraphNode = { type : Block . PARAGRAPH , content : [ createTextNode ( 'Paragraph' ) ] , } ; const strongMark = { type : Mark . STRONG , } ; const underlineMark = { type : Mark . UNDERLINE , } ; export const paragraphNodeWithStrongMark = { type : Block . PARAGRAPH , content : [ createTextNode ( 'Para' ) , createTextNode ( 'graph' , [ strongMark ] ) ] , } ; export const paragraphNodeWithMultipleMarks = { type : Block . PARAGRAPH , content : [ createTextNode ( 'Para' ) , createTextNode ( 'graph' , [ strongMark , underlineMark ] ) , ] , } ; export const componentNode = { type : ComponentType , attrs : { id : '123' , body : [ { sub : [ ] , _uid : '1' , title : 'Second button!' , component : 'button' , } , { sub : [ ] , _uid : '2' , title : 'My Button ' , component : 'button' , } , ] , } , } ;