Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoudy91 committed Feb 20, 2024
1 parent eed4035 commit c2115cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
15 changes: 4 additions & 11 deletions examples/22-create-rich-text-field-with-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,8 @@ module.exports = function (migration) {
}
},
{
enabledMarks: [
'bold',
'italic',
'underline',
'code',
'superscript',
'subscript'
],
message:
'Only bold, italic, underline, code, superscript, and subscript marks are allowed'
enabledMarks: ['bold', 'italic', 'underline', 'code', 'superscript', 'subscript'],
message: 'Only bold, italic, underline, code, superscript, and subscript marks are allowed'
},
{
enabledNodeTypes: [
Expand All @@ -76,7 +68,8 @@ module.exports = function (migration) {
'hyperlink',
'entry-hyperlink',
'asset-hyperlink',
'embedded-entry-inline'
'embedded-entry-inline',
'embedded-resource-block'
],
message:
'Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, table, link to Url, link to entry, link to asset, and inline entry nodes are allowed'
Expand Down
8 changes: 5 additions & 3 deletions test/integration/migration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1320,26 +1320,28 @@ describe('the migration', function () {
})

expect(ct.fields[0].type).to.eql('RichText')
expect(ct.fields[0].validations[1].enabledNodeTypes).to.eql([
expect(ct.fields[0].validations[2].enabledNodeTypes).to.eql([
'heading-1',
'heading-2',
'heading-3',
'heading-4',
'heading-5',
'heading-6',
'ordered-list',
'unordered-list',
'hr',
'blockquote',
'embedded-entry-block',
'embedded-asset-block',
'table',
'hyperlink',
'entry-hyperlink',
'asset-hyperlink',
'embedded-entry-inline',
'embedded-resource-block'
])
expect(ct.fields[0].validations[1].message).to.eql(
'Only heading 1, heading 2, heading 3, heading 4, heading 5, ordered list, unordered list, horizontal rule, quote, block entry, block embedded resource, asset, link to Url, link to entry, link to asset, and inline entry nodes are allowed'
expect(ct.fields[0].validations[2].message).to.eql(
'Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, table, block embedded resource, asset, link to Url, link to entry, link to asset, and inline entry nodes are allowed'
)
expect(ct.fields[0].validations[0].nodes['embedded-entry-block']).to.eql([
{
Expand Down

0 comments on commit c2115cb

Please sign in to comment.