Skip to content

Commit

Permalink
[test-studio] Add hoisted PT type test
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin committed Sep 7, 2020
1 parent 61bfeee commit 893592e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
44 changes: 44 additions & 0 deletions packages/test-studio/schemas/hoistedPt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export const customBlock = {
name: 'customHoistedBlock',
type: 'block',
title: 'A named custom block',
marks: {
annotations: [
{type: 'object', name: 'link', fields: [{type: 'string', name: 'url'}]},
{type: 'object', name: 'test', fields: [{type: 'string', name: 'mystring'}]}
]
},
of: [
{type: 'image'},
{
type: 'object',
name: 'test',
fields: [{type: 'string', name: 'mystring', validation: Rule => Rule.required()}]
},
{
type: 'reference',
name: 'strongAuthorRef',
title: 'A strong author ref',
to: {type: 'author'}
}
]
}

export const hoistedPt = {
name: 'hoistedPt',
type: 'array',
title: 'Hoisted PT array',
of: [{type: 'customHoistedBlock'}]
}

export const hoistedPtDocument = {
type: 'document',
name: 'documentWithHoistedPt',
title: 'Hoisted PT document',
fields: [
{
type: 'hoistedPt',
name: 'body'
}
]
}
6 changes: 5 additions & 1 deletion packages/test-studio/schemas/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import mux from './mux'
import review from './review'
import gallery from './gallery'
import presence, {objectWithNestedArray} from './presence'
import {customBlock, hoistedPt, hoistedPtDocument} from './hoistedPt'

export default createSchema({
name: 'test-examples',
Expand Down Expand Up @@ -122,6 +123,9 @@ export default createSchema({
simpleBlock,
simpleBlockNote,
simpleBlockNoteBody,
simpleBlockNoteUrl
simpleBlockNoteUrl,
hoistedPtDocument,
hoistedPt,
customBlock
])
})

1 comment on commit 893592e

@vercel
Copy link

@vercel vercel bot commented on 893592e Sep 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.