From 9e179b282abcc6981c79160cc824db8c22ca745b Mon Sep 17 00:00:00 2001 From: Tong Li Date: Fri, 14 Sep 2018 13:54:28 +1000 Subject: [PATCH 1/4] adds decorated data path --- .gitignore | 1 + package.json | 3 +- .../integration/__snapshots__/index.js.snap | 14 + src/__tests__/integration/adfSchema.json | 1582 +++++++++++++++++ src/__tests__/integration/index.js | 35 + .../invalid/link-without-attrs.json | 20 + src/json/get-decorated-data-pah.js | 36 + src/json/get-meta-from-path.js | 13 + src/json/index.js | 1 + src/validation-errors/base.js | 7 +- src/validation-errors/default.js | 2 +- src/validation-errors/enum.js | 14 +- src/validation-errors/required.js | 4 +- 13 files changed, 1724 insertions(+), 8 deletions(-) create mode 100644 src/__tests__/integration/__snapshots__/index.js.snap create mode 100644 src/__tests__/integration/adfSchema.json create mode 100644 src/__tests__/integration/index.js create mode 100644 src/__tests__/integration/invalid/link-without-attrs.json create mode 100644 src/json/get-decorated-data-pah.js diff --git a/.gitignore b/.gitignore index dc9a215f..3744e9fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /node_modules/ /coverage/ *.log +.vscode diff --git a/package.json b/package.json index f21dd8de..69c7a0d4 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@babel/plugin-transform-runtime": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-flow": "7.0.0", + "ajv": "^6.5.3", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^23.6.0", "babel-plugin-add-module-exports": "^1.0.0", @@ -68,7 +69,7 @@ }, "jest": { "testMatch": [ - "/src/**/__tests__/*.js" + "/src/**/__tests__/**/*.js" ] }, "prettier": { diff --git a/src/__tests__/integration/__snapshots__/index.js.snap b/src/__tests__/integration/__snapshots__/index.js.snap new file mode 100644 index 00000000..823024d8 --- /dev/null +++ b/src/__tests__/integration/__snapshots__/index.js.snap @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Integration Test - shows better error for 'link-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:link should have required property 'attrs'", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, +] +`; diff --git a/src/__tests__/integration/adfSchema.json b/src/__tests__/integration/adfSchema.json new file mode 100644 index 00000000..c3c4593b --- /dev/null +++ b/src/__tests__/integration/adfSchema.json @@ -0,0 +1,1582 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Schema for Atlassian Document Format.", + "$ref": "#/definitions/doc_node", + "definitions": { + "paragraph_node": { + "type": "object", + "properties": { + "type": { + "enum": ["paragraph"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/inline_node" + } + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "bulletList_node": { + "type": "object", + "properties": { + "type": { + "enum": ["bulletList"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/listItem_node" + }, + "minItems": 1 + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "media_node": { + "type": "object", + "properties": { + "type": { + "enum": ["media"] + }, + "attrs": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "enum": ["link", "file"] + }, + "id": { + "type": "string", + "minLength": 1 + }, + "collection": { + "type": "string" + }, + "height": { + "type": "number" + }, + "width": { + "type": "number" + }, + "occurrenceKey": { + "type": "string", + "minLength": 1 + } + }, + "required": ["type", "id", "collection"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": ["external"] + }, + "url": { + "type": "string" + }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + }, + "required": ["type", "url"], + "additionalProperties": false + } + ] + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "mediaSingle_node": { + "type": "object", + "properties": { + "type": { + "enum": ["mediaSingle"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/media_node" + }, + "minItems": 1, + "maxItems": 1 + }, + "attrs": { + "type": "object", + "properties": { + "layout": { + "enum": [ + "wrap-right", + "center", + "wrap-left", + "wide", + "full-width" + ] + } + }, + "required": ["layout"], + "additionalProperties": false + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "listItem_node": { + "type": "object", + "properties": { + "type": { + "enum": ["listItem"] + }, + "content": { + "type": "array", + "items": [ + { + "anyOf": [ + { + "$ref": "#/definitions/paragraph_node" + }, + { + "$ref": "#/definitions/mediaSingle_node" + } + ] + }, + { + "anyOf": [ + { + "$ref": "#/definitions/paragraph_node" + }, + { + "$ref": "#/definitions/bulletList_node" + }, + { + "$ref": "#/definitions/mediaSingle_node" + }, + { + "$ref": "#/definitions/orderedList_node" + } + ] + } + ], + "minItems": 1 + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "orderedList_node": { + "type": "object", + "properties": { + "type": { + "enum": ["orderedList"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/listItem_node" + }, + "minItems": 1 + }, + "attrs": { + "type": "object", + "properties": { + "order": { + "type": "number", + "minimum": 1 + } + }, + "required": ["order"], + "additionalProperties": false + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "heading_node": { + "type": "object", + "properties": { + "type": { + "enum": ["heading"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/inline_node" + }, + "minItems": 0 + }, + "attrs": { + "type": "object", + "properties": { + "level": { + "type": "number", + "minimum": 1, + "maximum": 6 + } + }, + "required": ["level"], + "additionalProperties": false + } + }, + "required": ["type", "content", "attrs"], + "additionalProperties": false + }, + "panel_node": { + "type": "object", + "properties": { + "type": { + "enum": ["panel"] + }, + "attrs": { + "type": "object", + "properties": { + "panelType": { + "enum": ["info", "note", "tip", "warning", "error", "success"] + } + }, + "required": ["panelType"], + "additionalProperties": false + }, + "content": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/paragraph_node" + }, + { + "$ref": "#/definitions/bulletList_node" + }, + { + "$ref": "#/definitions/orderedList_node" + }, + { + "$ref": "#/definitions/heading_node" + } + ] + }, + "minItems": 1 + } + }, + "required": ["type", "attrs", "content"], + "additionalProperties": false + }, + "blockquote_node": { + "type": "object", + "properties": { + "type": { + "enum": ["blockquote"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/paragraph_node" + }, + "minItems": 1 + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "rule_node": { + "type": "object", + "properties": { + "type": { + "enum": ["rule"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + "em_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["em"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + "code_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["code"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + "strike_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["strike"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + "strong_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["strong"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + "underline_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["underline"] + } + }, + "required": ["type"], + "additionalProperties": false + }, + "link_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["link"] + }, + "attrs": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "title": { + "type": "string" + }, + "id": { + "type": "string" + }, + "collection": { + "type": "string" + }, + "occurrenceKey": { + "type": "string" + } + }, + "required": ["href"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "subsup_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["subsup"] + }, + "attrs": { + "type": "object", + "properties": { + "type": { + "enum": ["sub", "sup"] + } + }, + "required": ["type"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "textColor_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["textColor"] + }, + "attrs": { + "type": "object", + "properties": { + "color": { + "type": "string", + "pattern": "^#[0-9a-f]{6}$" + } + }, + "required": ["color"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "action_mark": { + "type": "object", + "properties": { + "type": { + "enum": ["action"] + }, + "attrs": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "key": { + "type": "string" + }, + "target": { + "type": "object", + "properties": { + "receiver": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["key"] + }, + "parameters": {} + }, + "required": ["title", "target"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "hardBreak_node": { + "type": "object", + "properties": { + "type": { + "enum": ["hardBreak"] + }, + "attrs": { + "type": "object", + "properties": { + "text": { + "enum": ["\n"] + } + }, + "additionalProperties": false + } + }, + "required": ["type"], + "additionalProperties": false + }, + "emoji_node": { + "type": "object", + "properties": { + "type": { + "enum": ["emoji"] + }, + "attrs": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "shortName": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["shortName"] + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "mention_node": { + "type": "object", + "properties": { + "type": { + "enum": ["mention"] + }, + "attrs": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "userType": { + "enum": ["DEFAULT", "SPECIAL", "APP"] + }, + "accessLevel": { + "type": "string" + } + }, + "required": ["id"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "text_node": { + "type": "object", + "properties": { + "type": { + "enum": ["text"] + }, + "text": { + "type": "string", + "minLength": 1 + }, + "marks": { + "type": "array" + } + }, + "required": ["type", "text"], + "additionalProperties": false + }, + "mediaGroup_node": { + "type": "object", + "properties": { + "type": { + "enum": ["mediaGroup"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/media_node" + }, + "minItems": 1 + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "table_node": { + "type": "object", + "properties": { + "type": { + "enum": ["table"] + }, + "attrs": { + "type": "object", + "properties": { + "isNumberColumnEnabled": { + "type": "boolean" + }, + "layout": { + "enum": ["wide", "full-width", "default"] + } + }, + "additionalProperties": false + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/table_row_node" + }, + "minItems": 1 + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "table_row_node": { + "type": "object", + "properties": { + "type": { + "enum": ["tableRow"] + }, + "content": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/table_header_node" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/table_cell_node" + } + } + ] + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "table_cell_node": { + "type": "object", + "properties": { + "type": { + "enum": ["tableCell"] + }, + "attrs": { + "type": "object", + "properties": { + "colspan": { + "type": "number" + }, + "rowspan": { + "type": "number" + }, + "colwidth": { + "type": "array", + "items": { + "type": "number" + } + }, + "background": { + "type": "string" + } + }, + "additionalProperties": false + }, + "content": { + "$ref": "#/definitions/table_cell_content" + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "table_header_node": { + "type": "object", + "properties": { + "type": { + "enum": ["tableHeader"] + }, + "attrs": { + "type": "object", + "properties": { + "colspan": { + "type": "number" + }, + "rowspan": { + "type": "number" + }, + "colwidth": { + "type": "array", + "items": { + "type": "number" + } + }, + "background": { + "type": "string" + } + }, + "additionalProperties": false + }, + "content": { + "$ref": "#/definitions/table_cell_content" + } + }, + "required": ["type", "content"], + "additionalProperties": false + }, + "applicationCard_node": { + "type": "object", + "properties": { + "type": { + "enum": ["applicationCard"] + }, + "attrs": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "textUrl": { + "type": "string" + }, + "link": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https?://|^data:image/" + } + }, + "required": ["url"], + "additionalProperties": false + }, + "background": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https://|^data:image/" + } + }, + "required": ["url"], + "additionalProperties": false + }, + "collapsible": { + "type": "boolean" + }, + "preview": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https://|^data:image/" + } + }, + "required": ["url"], + "additionalProperties": false + }, + "title": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "icon": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https://|^data:image/" + }, + "label": { + "type": "string" + } + }, + "required": ["url", "label"], + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": ["icon"] + } + }, + "required": ["text"], + "additionalProperties": false + }, + "description": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "required": ["text"], + "additionalProperties": false + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "text": { + "type": "string" + }, + "icon": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https://|^data:image/" + }, + "label": { + "type": "string" + } + }, + "required": ["url", "label"], + "additionalProperties": false + }, + "badge": { + "type": "object", + "properties": { + "value": { + "type": "number" + }, + "max": { + "type": "number" + }, + "theme": { + "enum": ["default", "dark"] + }, + "appearance": { + "enum": [ + "default", + "primary", + "important", + "added", + "removed" + ] + } + }, + "required": ["value"], + "additionalProperties": false + }, + "lozenge": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "bold": { + "type": "boolean" + }, + "appearance": { + "enum": [ + "success", + "default", + "removed", + "inprogress", + "new", + "moved" + ] + } + }, + "required": ["text"], + "additionalProperties": false + }, + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "icon": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https://|^data:image/" + }, + "label": { + "type": "string" + } + }, + "required": ["url", "label"], + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": ["icon"] + } + } + }, + "additionalProperties": false + } + }, + "actions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "target": { + "type": "object", + "properties": { + "receiver": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["key"] + }, + "parameters": {} + }, + "additionalProperties": false, + "required": ["title", "target"] + } + }, + "context": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon": { + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "^https://|^data:image/" + }, + "label": { + "type": "string" + } + }, + "required": ["url", "label"], + "additionalProperties": false + } + }, + "required": ["text"], + "additionalProperties": false + } + }, + "required": ["text", "title"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "decisionItem_node": { + "type": "object", + "properties": { + "type": { + "enum": ["decisionItem"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/inline_node" + } + }, + "attrs": { + "type": "object", + "properties": { + "localId": { + "type": "string" + }, + "state": { + "type": "string" + } + }, + "required": ["localId", "state"], + "additionalProperties": false + } + }, + "required": ["type", "content", "attrs"], + "additionalProperties": false + }, + "decisionList_node": { + "type": "object", + "properties": { + "type": { + "enum": ["decisionList"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/decisionItem_node" + }, + "minItems": 1 + }, + "attrs": { + "type": "object", + "properties": { + "localId": { + "type": "string" + } + }, + "required": ["localId"], + "additionalProperties": false + } + }, + "required": ["type", "content", "attrs"], + "additionalProperties": false + }, + "taskItem_node": { + "type": "object", + "properties": { + "type": { + "enum": ["taskItem"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/inline_node" + } + }, + "attrs": { + "type": "object", + "properties": { + "localId": { + "type": "string" + }, + "state": { + "enum": ["TODO", "DONE"] + } + }, + "required": ["localId", "state"], + "additionalProperties": false + } + }, + "required": ["type", "content", "attrs"], + "additionalProperties": false + }, + "taskList_node": { + "type": "object", + "properties": { + "type": { + "enum": ["taskList"] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/taskItem_node" + }, + "minItems": 1 + }, + "attrs": { + "type": "object", + "properties": { + "localId": { + "type": "string" + } + }, + "required": ["localId"], + "additionalProperties": false + } + }, + "required": ["type", "content", "attrs"], + "additionalProperties": false + }, + "extension_node": { + "type": "object", + "properties": { + "type": { + "enum": ["extension"] + }, + "attrs": { + "type": "object", + "properties": { + "extensionKey": { + "type": "string", + "minLength": 1 + }, + "extensionType": { + "type": "string", + "minLength": 1 + }, + "parameters": {}, + "text": { + "type": "string" + }, + "layout": { + "enum": ["wide", "full-width", "default"] + } + }, + "required": ["extensionKey", "extensionType"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "inlineExtension_node": { + "type": "object", + "properties": { + "type": { + "enum": ["inlineExtension"] + }, + "attrs": { + "type": "object", + "properties": { + "extensionKey": { + "type": "string", + "minLength": 1 + }, + "extensionType": { + "type": "string", + "minLength": 1 + }, + "parameters": {}, + "text": { + "type": "string" + } + }, + "required": ["extensionKey", "extensionType"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "bodiedExtension_node": { + "type": "object", + "properties": { + "type": { + "enum": ["bodiedExtension"] + }, + "attrs": { + "type": "object", + "properties": { + "extensionKey": { + "type": "string", + "minLength": 1 + }, + "extensionType": { + "type": "string", + "minLength": 1 + }, + "parameters": {}, + "text": { + "type": "string" + }, + "layout": { + "enum": ["wide", "full-width", "default"] + } + }, + "required": ["extensionKey", "extensionType"], + "additionalProperties": false + }, + "content": { + "$ref": "#/definitions/extension_content" + } + }, + "required": ["type", "attrs", "content"], + "additionalProperties": false + }, + "date_node": { + "type": "object", + "properties": { + "type": { + "enum": ["date"] + }, + "attrs": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "minLength": 1 + } + }, + "required": ["timestamp"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "placeholder_node": { + "type": "object", + "properties": { + "type": { + "enum": ["placeholder"] + }, + "attrs": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "required": ["text"], + "additionalProperties": false + } + }, + "required": ["type", "attrs"], + "additionalProperties": false + }, + "codeBlock_node": { + "type": "object", + "properties": { + "type": { + "enum": ["codeBlock"] + }, + "content": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/text_node" + }, + { + "type": "object", + "properties": { + "marks": { + "type": "array", + "maxItems": 0 + } + }, + "additionalProperties": true + } + ] + } + }, + "attrs": { + "type": "object", + "properties": { + "language": { + "enum": [ + "abap", + "actionscript", + "ada", + "arduino", + "autoit", + "c", + "c++", + "clojure", + "coffeescript", + "csharp", + "css", + "cuda", + "d", + "dart", + "delphi", + "elixir", + "erlang", + "fortran", + "foxpro", + "go", + "groovy", + "haskell", + "haxe", + "html", + "java", + "javascript", + "json", + "julia", + "kotlin", + "latex", + "livescript", + "lua", + "mathematica", + "matlab", + "objective-c", + "objective-j", + "objectpascal", + "ocaml", + "octave", + "perl", + "php", + "powershell", + "prolog", + "puppet", + "python", + "qml", + "r", + "racket", + "restructuredtext", + "ruby", + "rust", + "sass", + "scala", + "scheme", + "shell", + "smalltalk", + "sql", + "standardml", + "swift", + "tcl", + "tex", + "typescript", + "vala", + "vbnet", + "verilog", + "vhdl", + "xml", + "xquery" + ] + } + }, + "additionalProperties": false + } + }, + "required": ["type"], + "additionalProperties": false + }, + "top_level_node": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/paragraph_node" + }, + { + "$ref": "#/definitions/bulletList_node" + }, + { + "$ref": "#/definitions/mediaSingle_node" + }, + { + "$ref": "#/definitions/orderedList_node" + }, + { + "$ref": "#/definitions/heading_node" + }, + { + "$ref": "#/definitions/panel_node" + }, + { + "$ref": "#/definitions/blockquote_node" + }, + { + "$ref": "#/definitions/rule_node" + }, + { + "$ref": "#/definitions/mediaGroup_node" + }, + { + "$ref": "#/definitions/table_node" + }, + { + "$ref": "#/definitions/applicationCard_node" + }, + { + "$ref": "#/definitions/decisionList_node" + }, + { + "$ref": "#/definitions/taskList_node" + }, + { + "$ref": "#/definitions/extension_node" + }, + { + "$ref": "#/definitions/bodiedExtension_node" + }, + { + "$ref": "#/definitions/codeBlock_node" + } + ] + }, + "minItems": 1 + }, + "table_cell_content": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/paragraph_node" + }, + { + "$ref": "#/definitions/bulletList_node" + }, + { + "$ref": "#/definitions/mediaSingle_node" + }, + { + "$ref": "#/definitions/orderedList_node" + }, + { + "$ref": "#/definitions/heading_node" + }, + { + "$ref": "#/definitions/panel_node" + }, + { + "$ref": "#/definitions/blockquote_node" + }, + { + "$ref": "#/definitions/rule_node" + }, + { + "$ref": "#/definitions/mediaGroup_node" + }, + { + "$ref": "#/definitions/applicationCard_node" + }, + { + "$ref": "#/definitions/decisionList_node" + }, + { + "$ref": "#/definitions/taskList_node" + }, + { + "$ref": "#/definitions/extension_node" + }, + { + "$ref": "#/definitions/codeBlock_node" + } + ] + }, + "minItems": 1 + }, + "extension_content": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/paragraph_node" + }, + { + "$ref": "#/definitions/bulletList_node" + }, + { + "$ref": "#/definitions/mediaSingle_node" + }, + { + "$ref": "#/definitions/orderedList_node" + }, + { + "$ref": "#/definitions/heading_node" + }, + { + "$ref": "#/definitions/panel_node" + }, + { + "$ref": "#/definitions/blockquote_node" + }, + { + "$ref": "#/definitions/rule_node" + }, + { + "$ref": "#/definitions/mediaGroup_node" + }, + { + "$ref": "#/definitions/table_node" + }, + { + "$ref": "#/definitions/applicationCard_node" + }, + { + "$ref": "#/definitions/decisionList_node" + }, + { + "$ref": "#/definitions/taskList_node" + }, + { + "$ref": "#/definitions/extension_node" + }, + { + "$ref": "#/definitions/codeBlock_node" + } + ] + }, + "minItems": 1 + }, + "formatted_text_inline_node": { + "allOf": [ + { + "$ref": "#/definitions/text_node" + }, + { + "type": "object", + "properties": { + "marks": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/em_mark" + }, + { + "$ref": "#/definitions/strike_mark" + }, + { + "$ref": "#/definitions/strong_mark" + }, + { + "$ref": "#/definitions/underline_mark" + }, + { + "$ref": "#/definitions/link_mark" + }, + { + "$ref": "#/definitions/subsup_mark" + }, + { + "$ref": "#/definitions/textColor_mark" + }, + { + "$ref": "#/definitions/action_mark" + } + ] + } + } + }, + "additionalProperties": true + } + ] + }, + "code_inline_node": { + "allOf": [ + { + "$ref": "#/definitions/text_node" + }, + { + "type": "object", + "properties": { + "marks": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/code_mark" + }, + { + "$ref": "#/definitions/link_mark" + } + ] + } + } + }, + "additionalProperties": true + } + ] + }, + "inline_node": { + "anyOf": [ + { + "$ref": "#/definitions/hardBreak_node" + }, + { + "$ref": "#/definitions/emoji_node" + }, + { + "$ref": "#/definitions/mention_node" + }, + { + "$ref": "#/definitions/inlineExtension_node" + }, + { + "$ref": "#/definitions/date_node" + }, + { + "$ref": "#/definitions/placeholder_node" + }, + { + "$ref": "#/definitions/formatted_text_inline_node" + }, + { + "$ref": "#/definitions/code_inline_node" + } + ] + }, + "doc_node": { + "type": "object", + "properties": { + "version": { + "enum": [1] + }, + "type": { + "enum": ["doc"] + }, + "content": { + "$ref": "#/definitions/top_level_node" + } + }, + "required": ["version", "type", "content"], + "additionalProperties": false + } + } +} diff --git a/src/__tests__/integration/index.js b/src/__tests__/integration/index.js new file mode 100644 index 00000000..053a2696 --- /dev/null +++ b/src/__tests__/integration/index.js @@ -0,0 +1,35 @@ +import * as adfSchema from './adfSchema.json'; +import Ajv from 'ajv'; +import betterAjvErrors from '../..'; +import fs from 'fs'; + +const ajv = new Ajv({ jsonPointers: true, schemaId: 'auto' }); +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); +const validate = ajv.compile(adfSchema); + +const readFilesSync = path => { + return fs.readdirSync(path).reduce((acc, name) => { + if (name.match(/\.json$/)) { + acc.push({ + name, + data: JSON.parse(fs.readFileSync(`${path}/${name}`, 'utf-8')), + }); + } + + return acc; + }, []); +}; + +describe('Integration Test - ', () => { + const invalid = readFilesSync(`${__dirname}/invalid`); + invalid.forEach(file => { + it(`shows better error for '${file.name}`, () => { + const valid = validate(file.data); + expect(valid).toBeFalsy(); + const output = betterAjvErrors(adfSchema, file.data, validate.errors, { + format: 'js', + }); + expect(output).toMatchSnapshot(); + }); + }); +}); diff --git a/src/__tests__/integration/invalid/link-without-attrs.json b/src/__tests__/integration/invalid/link-without-attrs.json new file mode 100644 index 00000000..2b2b27e2 --- /dev/null +++ b/src/__tests__/integration/invalid/link-without-attrs.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "link" + } + ] + } + ] + } + ] +} diff --git a/src/json/get-decorated-data-pah.js b/src/json/get-decorated-data-pah.js new file mode 100644 index 00000000..9d9e38b0 --- /dev/null +++ b/src/json/get-decorated-data-pah.js @@ -0,0 +1,36 @@ +export default function getMetaFromPath(jsonAst, dataPath) { + // TODO: Handle json pointer escape notation and better error handling + const pointers = dataPath.split('/').slice(1); + let decoratedPath = ''; + pointers.reduce((obj, pointer, idx) => { + switch (obj.type) { + case 'Object': { + decoratedPath += `/${pointer}`; + const filtered = obj.children.filter( + child => child.key.value === pointer + ); + if (filtered.length !== 1) { + throw new Error(`Couldn't find property ${pointer} of ${dataPath}`); + } + return filtered[0].value; + } + case 'Array': + decoratedPath += `/${pointer}${getTypeName(obj.children[pointer])}`; + return obj.children[pointer]; + default: + // eslint-disable-next-line no-console + console.log(obj); + } + }, jsonAst); + return decoratedPath; +} + +function getTypeName(obj) { + const type = obj.children.filter(child => child.key.value === 'type'); + + if (!type.length) { + return ''; + } + + return (type[0].value && `:${type[0].value.value}`) || ''; +} diff --git a/src/json/get-meta-from-path.js b/src/json/get-meta-from-path.js index e871a517..d2183512 100644 --- a/src/json/get-meta-from-path.js +++ b/src/json/get-meta-from-path.js @@ -6,9 +6,11 @@ export default function getMetaFromPath( // TODO: Handle json pointer escape notation and better error handling const pointers = dataPath.split('/').slice(1); const lastPointerIndex = pointers.length - 1; + let decoratedPath = ''; return pointers.reduce((obj, pointer, idx) => { switch (obj.type) { case 'Object': { + decoratedPath += `/${pointer}`; const filtered = obj.children.filter( child => child.key.value === pointer ); @@ -19,6 +21,7 @@ export default function getMetaFromPath( return isIdentifierLocation && idx === lastPointerIndex ? key : value; } case 'Array': + decoratedPath += `/${pointer}(${getTypeName(obj.children[pointer])})`; return obj.children[pointer]; default: // eslint-disable-next-line no-console @@ -26,3 +29,13 @@ export default function getMetaFromPath( } }, jsonAst); } + +function getTypeName(obj) { + const type = obj.children.filter(child => child.key.value === 'type'); + + if (!type.length) { + return ''; + } + + return (type[0].value && type[0].value.value) || ''; +} diff --git a/src/json/index.js b/src/json/index.js index 595c6b20..e79417e6 100644 --- a/src/json/index.js +++ b/src/json/index.js @@ -1 +1,2 @@ export { default as getMetaFromPath } from './get-meta-from-path'; +export { default as getDecoratedDataPath } from './get-decorated-data-pah'; diff --git a/src/validation-errors/base.js b/src/validation-errors/base.js index c1a9d5c1..4a890d62 100644 --- a/src/validation-errors/base.js +++ b/src/validation-errors/base.js @@ -1,5 +1,5 @@ import { codeFrameColumns } from '@babel/code-frame'; -import { getMetaFromPath } from '../json'; +import { getMetaFromPath, getDecoratedDataPath } from '../json'; export default class BaseValidationError { constructor( @@ -26,6 +26,11 @@ export default class BaseValidationError { }; } + getDecoratedPath(dataPath = this.options.dataPath) { + const decoratedPath = getDecoratedDataPath(this.jsonAst, dataPath); + return decoratedPath; + } + getCodeFrame(message, dataPath = this.options.dataPath) { return codeFrameColumns(this.jsonRaw, this.getLocation(dataPath), { highlightCode: true, diff --git a/src/validation-errors/default.js b/src/validation-errors/default.js index 2b4e4a8b..be93ac61 100644 --- a/src/validation-errors/default.js +++ b/src/validation-errors/default.js @@ -16,7 +16,7 @@ export default class DefaultValidationError extends BaseValidationError { return { ...this.getLocation(), - error: `${dataPath}: ${keyword} ${message}`, + error: `${this.getDecoratedPath(dataPath)}: ${keyword} ${message}`, }; } } diff --git a/src/validation-errors/enum.js b/src/validation-errors/enum.js index 147700c0..06bcfd65 100644 --- a/src/validation-errors/enum.js +++ b/src/validation-errors/enum.js @@ -5,7 +5,10 @@ import BaseValidationError from './base'; export default class EnumValidationError extends BaseValidationError { print() { - const { message, params: { allowedValues } } = this.options; + const { + message, + params: { allowedValues }, + } = this.options; const bestMatch = this.findBestMatch(); const output = [ @@ -28,7 +31,9 @@ export default class EnumValidationError extends BaseValidationError { const output = { ...this.getLocation(), - error: `${dataPath} ${message}: ${params.allowedValues.join(', ')}`, + error: `${this.getDecoratedPath( + dataPath + )} ${message}: ${params.allowedValues.join(', ')}`, }; if (bestMatch !== null) { @@ -39,7 +44,10 @@ export default class EnumValidationError extends BaseValidationError { } findBestMatch() { - const { dataPath, params: { allowedValues } } = this.options; + const { + dataPath, + params: { allowedValues }, + } = this.options; const currentValue = pointer.get(this.data, dataPath); if (!currentValue) { diff --git a/src/validation-errors/required.js b/src/validation-errors/required.js index 899b0b24..1b0c3110 100644 --- a/src/validation-errors/required.js +++ b/src/validation-errors/required.js @@ -19,11 +19,11 @@ export default class RequiredValidationError extends BaseValidationError { } getError() { - const { message, dataPath, params } = this.options; + const { message, dataPath } = this.options; return { ...this.getLocation(), - error: `${dataPath} ${message}`, + error: `${this.getDecoratedPath(dataPath)} ${message}`, }; } } From baeeff39e77cc36fb6ae66fe9b6c86b93cee8155 Mon Sep 17 00:00:00 2001 From: Tong Li Date: Fri, 14 Sep 2018 14:12:11 +1000 Subject: [PATCH 2/4] keep standard json pointer path --- src/__tests__/integration/__snapshots__/index.js.snap | 1 + src/validation-errors/__tests__/__snapshots__/main.js.snap | 6 +++++- src/validation-errors/additional-prop.js | 5 ++++- src/validation-errors/default.js | 1 + src/validation-errors/enum.js | 1 + src/validation-errors/required.js | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/__tests__/integration/__snapshots__/index.js.snap b/src/__tests__/integration/__snapshots__/index.js.snap index 823024d8..b343d611 100644 --- a/src/__tests__/integration/__snapshots__/index.js.snap +++ b/src/__tests__/integration/__snapshots__/index.js.snap @@ -4,6 +4,7 @@ exports[`Integration Test - shows better error for 'link-without-attrs.json 1`] Array [ Object { "error": "/content/0:paragraph/content/0:text/marks/0:link should have required property 'attrs'", + "path": "/content/0/content/0/marks/0", "start": Object { "column": 106, "line": 1, diff --git a/src/validation-errors/__tests__/__snapshots__/main.js.snap b/src/validation-errors/__tests__/__snapshots__/main.js.snap index 7838b3ab..e897c3f6 100644 --- a/src/validation-errors/__tests__/__snapshots__/main.js.snap +++ b/src/validation-errors/__tests__/__snapshots__/main.js.snap @@ -8,7 +8,8 @@ Array [ "line": 1, "offset": 26, }, - "error": "Property baz is not expected to be here", + "error": " Property baz is not expected to be here", + "path": "", "start": Object { "column": 22, "line": 1, @@ -27,6 +28,7 @@ Array [ "offset": 24, }, "error": "/id: type should be number", + "path": "/id", "start": Object { "column": 7, "line": 1, @@ -45,6 +47,7 @@ Array [ "offset": 11, }, "error": "/id should be equal to one of the allowed values: foo, bar", + "path": "/id", "start": Object { "column": 7, "line": 1, @@ -59,6 +62,7 @@ exports[`Main should support js output format for required errors 1`] = ` Array [ Object { "error": "/nested should have required property 'id'", + "path": "/nested", "start": Object { "column": 11, "line": 1, diff --git a/src/validation-errors/additional-prop.js b/src/validation-errors/additional-prop.js index 08c0b881..9dc5e6f8 100644 --- a/src/validation-errors/additional-prop.js +++ b/src/validation-errors/additional-prop.js @@ -26,7 +26,10 @@ export default class AdditionalPropValidationError extends BaseValidationError { return { ...this.getLocation(`${dataPath}/${params.additionalProperty}`), - error: `Property ${params.additionalProperty} is not expected to be here`, + error: `${this.getDecoratedPath(dataPath)} Property ${ + params.additionalProperty + } is not expected to be here`, + path: dataPath, }; } } diff --git a/src/validation-errors/default.js b/src/validation-errors/default.js index be93ac61..7239945e 100644 --- a/src/validation-errors/default.js +++ b/src/validation-errors/default.js @@ -17,6 +17,7 @@ export default class DefaultValidationError extends BaseValidationError { return { ...this.getLocation(), error: `${this.getDecoratedPath(dataPath)}: ${keyword} ${message}`, + path: dataPath, }; } } diff --git a/src/validation-errors/enum.js b/src/validation-errors/enum.js index 06bcfd65..2d9e9cbf 100644 --- a/src/validation-errors/enum.js +++ b/src/validation-errors/enum.js @@ -34,6 +34,7 @@ export default class EnumValidationError extends BaseValidationError { error: `${this.getDecoratedPath( dataPath )} ${message}: ${params.allowedValues.join(', ')}`, + path: dataPath, }; if (bestMatch !== null) { diff --git a/src/validation-errors/required.js b/src/validation-errors/required.js index 1b0c3110..711814cb 100644 --- a/src/validation-errors/required.js +++ b/src/validation-errors/required.js @@ -24,6 +24,7 @@ export default class RequiredValidationError extends BaseValidationError { return { ...this.getLocation(), error: `${this.getDecoratedPath(dataPath)} ${message}`, + path: dataPath, }; } } From 8e487c756285398825b1d31106b0931a3587988c Mon Sep 17 00:00:00 2001 From: Tong Li Date: Fri, 14 Sep 2018 14:14:32 +1000 Subject: [PATCH 3/4] migrate tests --- .../integration/__snapshots__/index.js.snap | 5610 ++++++++++++++++- ...cationCard-with-additional-properties.json | 83 + .../applicationCard-with-wrong-details.json | 82 + .../applicationCard-with-wrong-link.json | 80 + .../applicationCard-with-wrong-title.json | 81 + .../applicationCard-without-attrs-text.json | 82 + .../applicationCard-without-link-url.json | 80 + .../invalid/blockQuote-with-attrs.json | 21 + .../blockQuote-with-empty-content.json | 10 + .../invalid/blockQuote-with-marks.json | 21 + .../invalid/blockQuote-without-content.json | 9 + .../invalid/blockquote-with-list-inside.json | 30 + ...extension-with-nested-bodiedExtension.json | 28 + .../bodied-extension-without-content.json | 13 + ...bodied-extension-without-extensionKey.json | 18 + ...odied-extension-without-extensionType.json | 18 + .../invalid/bulletList-with-attrs.json | 21 + .../bulletList-with-empty-content.json | 10 + .../invalid/bulletList-with-marks.json | 26 + .../bulletList-with-not-listItem-content.json | 20 + .../invalid/bulletList-without-content.json | 9 + .../integration/invalid/code-and-em.json | 23 + .../integration/invalid/code-and-strike.json | 23 + .../integration/invalid/code-and-strong.json | 23 + .../integration/invalid/code-and-subsup.json | 23 + .../invalid/code-and-underline.json | 23 + .../integration/invalid/code-with-attrs.json | 21 + .../invalid/codeBlock-with-marks.json | 14 + .../invalid/codeBlock-with-non-text.json | 14 + .../invalid/codeBlock-with-strong.json | 20 + .../invalid/codeBlock-with-unknown-attrs.json | 13 + .../codeBlock-with-unknown-language.json | 13 + .../invalid/decision-with-blockquote.json | 31 + .../decisionList-with-empty-decision.json | 23 + .../decisionList-with-no-decision.json | 13 + .../integration/invalid/doc-with-attrs.json | 10 + .../invalid/doc-with-empty-content.json | 5 + .../integration/invalid/doc-with-marks.json | 10 + .../invalid/doc-without-content.json | 4 + .../invalid/doc-without-version.json | 4 + .../integration/invalid/em-with-attrs.json | 21 + .../invalid/emoji-as-top-level-node.json | 12 + .../invalid/emoji-with-content.json | 23 + .../invalid/emoji-with-empty-attrs.json | 15 + .../integration/invalid/emoji-with-marks.json | 18 + .../invalid/emoji-with-unknown-attr.json | 18 + .../invalid/emoji-without-attrs.json | 14 + .../invalid/extension-with-content.json | 19 + .../extension-without-extensionKey.json | 12 + .../extension-without-extensionType.json | 12 + .../invalid/hardBreak-with-marks.json | 18 + .../invalid/hardBreak-with-wrong-text.json | 17 + .../heading-with-invalid-level-attr.json | 18 + .../invalid/heading-with-marks.json | 14 + .../invalid/heading-with-non-text-block.json | 14 + .../invalid/heading-with-non-text-inline.json | 18 + .../invalid/heading-with-unknown-attrs.json | 19 + .../invalid/heading-without-attrs.json | 10 + .../invalid/inlineExtension-with-content.json | 24 + .../inlineExtension-without-extensionKey.json | 17 + ...inlineExtension-without-extensionType.json | 17 + .../invalid/link-with-empty-attrs.json | 21 + .../invalid/link-with-unknown-attr.json | 21 + .../invalid/list-with-blockquote.json | 31 + .../invalid/list-with-codeBlock.json | 24 + .../invalid/listItem-with-attrs.json | 26 + .../invalid/listItem-with-empty-content.json | 15 + .../listItem-with-list-as-first-child.json | 35 + .../invalid/listItem-with-marks.json | 26 + .../invalid/media-as-top-level-node.json | 13 + .../invalid/media-with-empty-attrs.json | 15 + ...edia-with-invalid-occurrence-key-attr.json | 20 + .../integration/invalid/media-with-marks.json | 19 + .../invalid/media-with-unknown-attr.json | 19 + .../invalid/media-without-attrs.json | 14 + .../invalid/media-without-id-attr.json | 17 + .../invalid/media-without-type-attr.json | 17 + .../invalid/mediaGroup-with-attrs.json | 19 + .../mediaGroup-with-empty-content.json | 10 + .../invalid/mediaGroup-with-marks.json | 19 + .../invalid/mediaGroup-without-content.json | 9 + .../invalid/mediaSingle-with-empty-attrs.json | 11 + .../mediaSingle-with-empty-content.json | 10 + .../mediaSingle-with-invalid-layout-attr.json | 38 + .../invalid/mention-with-extra-attrs.json | 19 + .../mention-with-invalid-user-type.json | 19 + .../invalid/mention-with-marks.json | 19 + .../invalid/mention-without-attrs.json | 14 + .../integration/invalid/mono-with-attrs.json | 21 + .../invalid/orderedList-with-extra-attrs.json | 38 + .../invalid/orderedList-with-marks.json | 38 + .../invalid/orderedList-without-content.json | 15 + .../invalid/panel-with-blockquote.json | 29 + .../invalid/panel-with-codeBlock.json | 22 + .../invalid/panel-with-empty-attrs.json | 21 + .../integration/invalid/panel-with-marks.json | 24 + .../integration/invalid/panel-with-panel.json | 29 + .../invalid/panel-with-unknown-attr.json | 24 + .../invalid/panel-without-attrs.json | 20 + .../invalid/paragraph-with-marks.json | 11 + ...paragraph-with-text-with-unknown-mark.json | 20 + .../paragraph-with-top-level-content.json | 14 + .../invalid/paragraph-without-content.json | 9 + .../invalid/placeholder-with-content.json | 23 + .../invalid/placeholder-with-empty-attrs.json | 15 + .../integration/invalid/rule-with-attrs.json | 10 + .../invalid/rule-with-content.json | 10 + .../integration/invalid/rule-with-marks.json | 10 + .../invalid/strike-with-attrs.json | 21 + .../invalid/strong-with-attrs.json | 21 + .../invalid/subsup-with-extra-attrs.json | 24 + .../subsup-with-invalid-type-attr.json | 23 + .../invalid/subsup-without-attrs.json | 20 + .../invalid/subsup-without-type-attr.json | 21 + .../invalid/table-with-nested-table.json | 50 + .../invalid/table-without-cells.json | 15 + .../invalid/table-without-rows.json | 10 + .../invalid/task-with-blockquote.json | 31 + .../invalid/task-with-invalid-state.json | 27 + .../invalid/taskList-with-empty-task.json | 23 + .../invalid/taskList-with-no-task.json | 13 + .../integration/invalid/text-empty.json | 15 + .../invalid/textColor-with-extra-attrs.json | 24 + .../textColor-with-invalid-color-attr.json | 23 + .../invalid/textColor-without-attrs.json | 20 + .../invalid/textColor-without-color-attr.json | 21 + .../invalid/underline-with-attrs.json | 21 + 127 files changed, 8357 insertions(+), 1 deletion(-) create mode 100644 src/__tests__/integration/invalid/applicationCard-with-additional-properties.json create mode 100644 src/__tests__/integration/invalid/applicationCard-with-wrong-details.json create mode 100644 src/__tests__/integration/invalid/applicationCard-with-wrong-link.json create mode 100644 src/__tests__/integration/invalid/applicationCard-with-wrong-title.json create mode 100644 src/__tests__/integration/invalid/applicationCard-without-attrs-text.json create mode 100644 src/__tests__/integration/invalid/applicationCard-without-link-url.json create mode 100644 src/__tests__/integration/invalid/blockQuote-with-attrs.json create mode 100644 src/__tests__/integration/invalid/blockQuote-with-empty-content.json create mode 100644 src/__tests__/integration/invalid/blockQuote-with-marks.json create mode 100644 src/__tests__/integration/invalid/blockQuote-without-content.json create mode 100644 src/__tests__/integration/invalid/blockquote-with-list-inside.json create mode 100644 src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json create mode 100644 src/__tests__/integration/invalid/bodied-extension-without-content.json create mode 100644 src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json create mode 100644 src/__tests__/integration/invalid/bodied-extension-without-extensionType.json create mode 100644 src/__tests__/integration/invalid/bulletList-with-attrs.json create mode 100644 src/__tests__/integration/invalid/bulletList-with-empty-content.json create mode 100644 src/__tests__/integration/invalid/bulletList-with-marks.json create mode 100644 src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json create mode 100644 src/__tests__/integration/invalid/bulletList-without-content.json create mode 100644 src/__tests__/integration/invalid/code-and-em.json create mode 100644 src/__tests__/integration/invalid/code-and-strike.json create mode 100644 src/__tests__/integration/invalid/code-and-strong.json create mode 100644 src/__tests__/integration/invalid/code-and-subsup.json create mode 100644 src/__tests__/integration/invalid/code-and-underline.json create mode 100644 src/__tests__/integration/invalid/code-with-attrs.json create mode 100644 src/__tests__/integration/invalid/codeBlock-with-marks.json create mode 100644 src/__tests__/integration/invalid/codeBlock-with-non-text.json create mode 100644 src/__tests__/integration/invalid/codeBlock-with-strong.json create mode 100644 src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json create mode 100644 src/__tests__/integration/invalid/codeBlock-with-unknown-language.json create mode 100644 src/__tests__/integration/invalid/decision-with-blockquote.json create mode 100644 src/__tests__/integration/invalid/decisionList-with-empty-decision.json create mode 100644 src/__tests__/integration/invalid/decisionList-with-no-decision.json create mode 100644 src/__tests__/integration/invalid/doc-with-attrs.json create mode 100644 src/__tests__/integration/invalid/doc-with-empty-content.json create mode 100644 src/__tests__/integration/invalid/doc-with-marks.json create mode 100644 src/__tests__/integration/invalid/doc-without-content.json create mode 100644 src/__tests__/integration/invalid/doc-without-version.json create mode 100644 src/__tests__/integration/invalid/em-with-attrs.json create mode 100644 src/__tests__/integration/invalid/emoji-as-top-level-node.json create mode 100644 src/__tests__/integration/invalid/emoji-with-content.json create mode 100644 src/__tests__/integration/invalid/emoji-with-empty-attrs.json create mode 100644 src/__tests__/integration/invalid/emoji-with-marks.json create mode 100644 src/__tests__/integration/invalid/emoji-with-unknown-attr.json create mode 100644 src/__tests__/integration/invalid/emoji-without-attrs.json create mode 100644 src/__tests__/integration/invalid/extension-with-content.json create mode 100644 src/__tests__/integration/invalid/extension-without-extensionKey.json create mode 100644 src/__tests__/integration/invalid/extension-without-extensionType.json create mode 100644 src/__tests__/integration/invalid/hardBreak-with-marks.json create mode 100644 src/__tests__/integration/invalid/hardBreak-with-wrong-text.json create mode 100644 src/__tests__/integration/invalid/heading-with-invalid-level-attr.json create mode 100644 src/__tests__/integration/invalid/heading-with-marks.json create mode 100644 src/__tests__/integration/invalid/heading-with-non-text-block.json create mode 100644 src/__tests__/integration/invalid/heading-with-non-text-inline.json create mode 100644 src/__tests__/integration/invalid/heading-with-unknown-attrs.json create mode 100644 src/__tests__/integration/invalid/heading-without-attrs.json create mode 100644 src/__tests__/integration/invalid/inlineExtension-with-content.json create mode 100644 src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json create mode 100644 src/__tests__/integration/invalid/inlineExtension-without-extensionType.json create mode 100644 src/__tests__/integration/invalid/link-with-empty-attrs.json create mode 100644 src/__tests__/integration/invalid/link-with-unknown-attr.json create mode 100644 src/__tests__/integration/invalid/list-with-blockquote.json create mode 100644 src/__tests__/integration/invalid/list-with-codeBlock.json create mode 100644 src/__tests__/integration/invalid/listItem-with-attrs.json create mode 100644 src/__tests__/integration/invalid/listItem-with-empty-content.json create mode 100644 src/__tests__/integration/invalid/listItem-with-list-as-first-child.json create mode 100644 src/__tests__/integration/invalid/listItem-with-marks.json create mode 100644 src/__tests__/integration/invalid/media-as-top-level-node.json create mode 100644 src/__tests__/integration/invalid/media-with-empty-attrs.json create mode 100644 src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json create mode 100644 src/__tests__/integration/invalid/media-with-marks.json create mode 100644 src/__tests__/integration/invalid/media-with-unknown-attr.json create mode 100644 src/__tests__/integration/invalid/media-without-attrs.json create mode 100644 src/__tests__/integration/invalid/media-without-id-attr.json create mode 100644 src/__tests__/integration/invalid/media-without-type-attr.json create mode 100644 src/__tests__/integration/invalid/mediaGroup-with-attrs.json create mode 100644 src/__tests__/integration/invalid/mediaGroup-with-empty-content.json create mode 100644 src/__tests__/integration/invalid/mediaGroup-with-marks.json create mode 100644 src/__tests__/integration/invalid/mediaGroup-without-content.json create mode 100644 src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json create mode 100644 src/__tests__/integration/invalid/mediaSingle-with-empty-content.json create mode 100644 src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json create mode 100644 src/__tests__/integration/invalid/mention-with-extra-attrs.json create mode 100644 src/__tests__/integration/invalid/mention-with-invalid-user-type.json create mode 100644 src/__tests__/integration/invalid/mention-with-marks.json create mode 100644 src/__tests__/integration/invalid/mention-without-attrs.json create mode 100644 src/__tests__/integration/invalid/mono-with-attrs.json create mode 100644 src/__tests__/integration/invalid/orderedList-with-extra-attrs.json create mode 100644 src/__tests__/integration/invalid/orderedList-with-marks.json create mode 100644 src/__tests__/integration/invalid/orderedList-without-content.json create mode 100644 src/__tests__/integration/invalid/panel-with-blockquote.json create mode 100644 src/__tests__/integration/invalid/panel-with-codeBlock.json create mode 100644 src/__tests__/integration/invalid/panel-with-empty-attrs.json create mode 100644 src/__tests__/integration/invalid/panel-with-marks.json create mode 100644 src/__tests__/integration/invalid/panel-with-panel.json create mode 100644 src/__tests__/integration/invalid/panel-with-unknown-attr.json create mode 100644 src/__tests__/integration/invalid/panel-without-attrs.json create mode 100644 src/__tests__/integration/invalid/paragraph-with-marks.json create mode 100644 src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json create mode 100644 src/__tests__/integration/invalid/paragraph-with-top-level-content.json create mode 100644 src/__tests__/integration/invalid/paragraph-without-content.json create mode 100644 src/__tests__/integration/invalid/placeholder-with-content.json create mode 100644 src/__tests__/integration/invalid/placeholder-with-empty-attrs.json create mode 100644 src/__tests__/integration/invalid/rule-with-attrs.json create mode 100644 src/__tests__/integration/invalid/rule-with-content.json create mode 100644 src/__tests__/integration/invalid/rule-with-marks.json create mode 100644 src/__tests__/integration/invalid/strike-with-attrs.json create mode 100644 src/__tests__/integration/invalid/strong-with-attrs.json create mode 100644 src/__tests__/integration/invalid/subsup-with-extra-attrs.json create mode 100644 src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json create mode 100644 src/__tests__/integration/invalid/subsup-without-attrs.json create mode 100644 src/__tests__/integration/invalid/subsup-without-type-attr.json create mode 100644 src/__tests__/integration/invalid/table-with-nested-table.json create mode 100644 src/__tests__/integration/invalid/table-without-cells.json create mode 100644 src/__tests__/integration/invalid/table-without-rows.json create mode 100644 src/__tests__/integration/invalid/task-with-blockquote.json create mode 100644 src/__tests__/integration/invalid/task-with-invalid-state.json create mode 100644 src/__tests__/integration/invalid/taskList-with-empty-task.json create mode 100644 src/__tests__/integration/invalid/taskList-with-no-task.json create mode 100644 src/__tests__/integration/invalid/text-empty.json create mode 100644 src/__tests__/integration/invalid/textColor-with-extra-attrs.json create mode 100644 src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json create mode 100644 src/__tests__/integration/invalid/textColor-without-attrs.json create mode 100644 src/__tests__/integration/invalid/textColor-without-color-attr.json create mode 100644 src/__tests__/integration/invalid/underline-with-attrs.json diff --git a/src/__tests__/integration/__snapshots__/index.js.snap b/src/__tests__/integration/__snapshots__/index.js.snap index b343d611..d61f9a7a 100644 --- a/src/__tests__/integration/__snapshots__/index.js.snap +++ b/src/__tests__/integration/__snapshots__/index.js.snap @@ -1,9 +1,5584 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Integration Test - shows better error for 'applicationCard-with-additional-properties.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 93, + "line": 1, + "offset": 92, + }, + "error": "/content/0:applicationCard/attrs Property text2 is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 86, + "line": 1, + "offset": 85, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'applicationCard-with-wrong-details.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 548, + "line": 1, + "offset": 547, + }, + "error": "/content/0:applicationCard/attrs/details/0/badge/theme should be equal to one of the allowed values: default, dark", + "path": "/content/0/attrs/details/0/badge/theme", + "start": Object { + "column": 541, + "line": 1, + "offset": 540, + }, + "suggestion": "Did you mean dark?", + }, +] +`; + +exports[`Integration Test - shows better error for 'applicationCard-with-wrong-link.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 158, + "line": 1, + "offset": 157, + }, + "error": "/content/0:applicationCard/attrs/link: type should be object", + "path": "/content/0/attrs/link", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'applicationCard-with-wrong-title.json 1`] = ` +Array [ + Object { + "error": "/content/0:applicationCard/attrs/title should have required property 'text'", + "path": "/content/0/attrs/title", + "start": Object { + "column": 289, + "line": 1, + "offset": 288, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'applicationCard-without-attrs-text.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + "error": "/content/0:applicationCard Property text is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, + Object { + "end": Object { + "column": 872, + "line": 1, + "offset": 871, + }, + "error": "/content/0:applicationCard: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'applicationCard-without-link-url.json 1`] = ` +Array [ + Object { + "error": "/content/0:applicationCard/attrs/link should have required property 'url'", + "path": "/content/0/attrs/link", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'blockQuote-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "error": "/content/0:blockquote/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'blockQuote-with-empty-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + "error": "/content/0:blockquote/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'blockQuote-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:blockquote Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:blockquote Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:blockquote Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:blockquote Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + }, + Object { + "end": Object { + "column": 144, + "line": 1, + "offset": 143, + }, + "error": "/content/0:blockquote: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'blockQuote-without-content.json 1`] = ` +Array [ + Object { + "error": "/content/0:blockquote should have required property 'content'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'blockquote-with-list-inside.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 90, + "line": 1, + "offset": 89, + }, + "error": "/content/0:blockquote/content/0:bulletList/type should be equal to one of the allowed values: paragraph", + "path": "/content/0/content/0/type", + "start": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "suggestion": "Did you mean paragraph?", + }, +] +`; + +exports[`Integration Test - shows better error for 'bodied-extension-with-nested-bodiedExtension.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 188, + "line": 1, + "offset": 187, + }, + "error": "/content/0:bodiedExtension/content/0:bodiedExtension/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, codeBlock", + "path": "/content/0/content/0/type", + "start": Object { + "column": 171, + "line": 1, + "offset": 170, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'bodied-extension-without-content.json 1`] = ` +Array [ + Object { + "error": "/content/0:bodiedExtension should have required property 'content'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'bodied-extension-without-extensionKey.json 1`] = ` +Array [ + Object { + "error": "/content/0:bodiedExtension/attrs should have required property 'extensionKey'", + "path": "/content/0/attrs", + "start": Object { + "column": 72, + "line": 1, + "offset": 71, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'bodied-extension-without-extensionType.json 1`] = ` +Array [ + Object { + "error": "/content/0:bodiedExtension/attrs should have required property 'extensionType'", + "path": "/content/0/attrs", + "start": Object { + "column": 72, + "line": 1, + "offset": 71, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'bulletList-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "error": "/content/0:bulletList/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "suggestion": "Did you mean orderedList?", + }, +] +`; + +exports[`Integration Test - shows better error for 'bulletList-with-empty-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + "error": "/content/0:bulletList/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'bulletList-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:bulletList Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:bulletList Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:bulletList Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 172, + "line": 1, + "offset": 171, + }, + "error": "/content/0:bulletList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + }, + Object { + "end": Object { + "column": 176, + "line": 1, + "offset": 175, + }, + "error": "/content/0:bulletList: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'bulletList-with-not-listItem-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + "error": "/content/0:bulletList/content/0:paragraph/type should be equal to one of the allowed values: listItem", + "path": "/content/0/content/0/type", + "start": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "suggestion": "Did you mean listItem?", + }, +] +`; + +exports[`Integration Test - shows better error for 'bulletList-without-content.json 1`] = ` +Array [ + Object { + "error": "/content/0:bulletList should have required property 'content'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'code-and-em.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, + Object { + "end": Object { + "column": 134, + "line": 1, + "offset": 133, + }, + "error": "/content/0:paragraph/content/0:text/marks/1:em/type should be equal to one of the allowed values: code, link", + "path": "/content/0/content/0/marks/1/type", + "start": Object { + "column": 130, + "line": 1, + "offset": 129, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'code-and-strike.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:text/marks/1:strike/type should be equal to one of the allowed values: code, link", + "path": "/content/0/content/0/marks/1/type", + "start": Object { + "column": 130, + "line": 1, + "offset": 129, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'code-and-strong.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:text/marks/1:strong/type should be equal to one of the allowed values: code, link", + "path": "/content/0/content/0/marks/1/type", + "start": Object { + "column": 130, + "line": 1, + "offset": 129, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'code-and-subsup.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:text/marks/1:subsup/type should be equal to one of the allowed values: code, link", + "path": "/content/0/content/0/marks/1/type", + "start": Object { + "column": 130, + "line": 1, + "offset": 129, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'code-and-underline.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, + Object { + "end": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + "error": "/content/0:paragraph/content/0:text/marks/1:underline/type should be equal to one of the allowed values: code, link", + "path": "/content/0/content/0/marks/1/type", + "start": Object { + "column": 130, + "line": 1, + "offset": 129, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'code-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: link, subsup, textColor, action, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'codeBlock-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 67, + "line": 1, + "offset": 66, + }, + "error": "/content/0:codeBlock Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 67, + "line": 1, + "offset": 66, + }, + "error": "/content/0:codeBlock Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 67, + "line": 1, + "offset": 66, + }, + "error": "/content/0:codeBlock Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 112, + "line": 1, + "offset": 111, + }, + "error": "/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, + Object { + "end": Object { + "column": 116, + "line": 1, + "offset": 115, + }, + "error": "/content/0:codeBlock: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'codeBlock-with-non-text.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 83, + "line": 1, + "offset": 82, + }, + "error": "/content/0:codeBlock/content/0:rule/type should be equal to one of the allowed values: text", + "path": "/content/0/content/0/type", + "start": Object { + "column": 77, + "line": 1, + "offset": 76, + }, + "suggestion": "Did you mean text?", + }, +] +`; + +exports[`Integration Test - shows better error for 'codeBlock-with-strong.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + "error": "/content/0:codeBlock/content/0:text/marks: maxItems should NOT have more than 0 items", + "path": "/content/0/content/0/marks", + "start": Object { + "column": 92, + "line": 1, + "offset": 91, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'codeBlock-with-unknown-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:codeBlock/attrs/language should be equal to one of the allowed values: abap, actionscript, ada, arduino, autoit, c, c++, clojure, coffeescript, csharp, css, cuda, d, dart, delphi, elixir, erlang, fortran, foxpro, go, groovy, haskell, haxe, html, java, javascript, json, julia, kotlin, latex, livescript, lua, mathematica, matlab, objective-c, objective-j, objectpascal, ocaml, octave, perl, php, powershell, prolog, puppet, python, qml, r, racket, restructuredtext, ruby, rust, sass, scala, scheme, shell, smalltalk, sql, standardml, swift, tcl, tex, typescript, vala, vbnet, verilog, vhdl, xml, xquery", + "path": "/content/0/attrs/language", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'codeBlock-with-unknown-language.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 85, + "line": 1, + "offset": 84, + }, + "error": "/content/0:codeBlock/attrs Property foo is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 80, + "line": 1, + "offset": 79, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'decision-with-blockquote.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 219, + "line": 1, + "offset": 218, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 210, + "line": 1, + "offset": 209, + }, + }, + Object { + "end": Object { + "column": 238, + "line": 1, + "offset": 237, + }, + "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote: anyOf should match some schema in anyOf", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 189, + "line": 1, + "offset": 188, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'decisionList-with-empty-decision.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 77, + "line": 1, + "offset": 76, + }, + "error": "/content/0:decisionList/attrs Property order is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'decisionList-with-no-decision.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 93, + "line": 1, + "offset": 92, + }, + "error": "/content/0:decisionList/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'doc-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 62, + "line": 1, + "offset": 61, + }, + "error": " Property attrs is not expected to be here", + "path": "", + "start": Object { + "column": 55, + "line": 1, + "offset": 54, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'doc-with-empty-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 39, + "line": 1, + "offset": 38, + }, + "error": "/content: minItems should NOT have less than 1 items", + "path": "/content", + "start": Object { + "column": 37, + "line": 1, + "offset": 36, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'doc-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 62, + "line": 1, + "offset": 61, + }, + "error": " Property marks is not expected to be here", + "path": "", + "start": Object { + "column": 55, + "line": 1, + "offset": 54, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'doc-without-content.json 1`] = ` +Array [ + Object { + "error": " should have required property 'content'", + "path": "", + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'doc-without-version.json 1`] = ` +Array [ + Object { + "error": " should have required property 'version'", + "path": "", + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'em-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:em/type should be equal to one of the allowed values: link, subsup, textColor, action, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'emoji-as-top-level-node.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "error": "/content/0:emoji/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, applicationCard, decisionList, taskList, extension, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'emoji-with-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 115, + "line": 1, + "offset": 114, + }, + "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 115, + "line": 1, + "offset": 114, + }, + "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 115, + "line": 1, + "offset": 114, + }, + "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 115, + "line": 1, + "offset": 114, + }, + "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 115, + "line": 1, + "offset": 114, + }, + "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 115, + "line": 1, + "offset": 114, + }, + "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 92, + "line": 1, + "offset": 91, + }, + "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 85, + "line": 1, + "offset": 84, + }, + }, + Object { + "end": Object { + "column": 92, + "line": 1, + "offset": 91, + }, + "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 85, + "line": 1, + "offset": 84, + }, + }, + Object { + "end": Object { + "column": 144, + "line": 1, + "offset": 143, + }, + "error": "/content/0:paragraph/content/0:emoji: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'emoji-with-empty-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:emoji/attrs should have required property 'shortName'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 93, + "line": 1, + "offset": 92, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'emoji-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, + Object { + "end": Object { + "column": 92, + "line": 1, + "offset": 91, + }, + "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 85, + "line": 1, + "offset": 84, + }, + }, + Object { + "end": Object { + "column": 92, + "line": 1, + "offset": 91, + }, + "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 85, + "line": 1, + "offset": 84, + }, + }, + Object { + "end": Object { + "column": 117, + "line": 1, + "offset": 116, + }, + "error": "/content/0:paragraph/content/0:emoji: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'emoji-with-unknown-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 110, + "line": 1, + "offset": 109, + }, + "error": "/content/0:paragraph/content/0:emoji/attrs Property foo is not expected to be here", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'emoji-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:emoji should have required property 'attrs'", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'extension-with-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 57, + "line": 1, + "offset": 56, + }, + "error": "/content/0:extension/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "suggestion": "Did you mean bodiedExtension?", + }, +] +`; + +exports[`Integration Test - shows better error for 'extension-without-extensionKey.json 1`] = ` +Array [ + Object { + "error": "/content/0:extension/attrs should have required property 'extensionKey'", + "path": "/content/0/attrs", + "start": Object { + "column": 66, + "line": 1, + "offset": 65, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'extension-without-extensionType.json 1`] = ` +Array [ + Object { + "error": "/content/0:extension/attrs should have required property 'extensionType'", + "path": "/content/0/attrs", + "start": Object { + "column": 66, + "line": 1, + "offset": 65, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'hardBreak-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + }, + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + }, + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + }, + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + }, + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + }, + Object { + "end": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 111, + "line": 1, + "offset": 110, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:paragraph/content/0:hardBreak Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 122, + "line": 1, + "offset": 121, + }, + "error": "/content/0:paragraph/content/0:hardBreak: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'hardBreak-with-wrong-text.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 88, + "line": 1, + "offset": 87, + }, + "error": "/content/0:paragraph/content/0:hardBreak/type should be equal to one of the allowed values: emoji, mention, inlineExtension, date, placeholder", + "path": "/content/0/content/0/type", + "start": Object { + "column": 77, + "line": 1, + "offset": 76, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'heading-with-invalid-level-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 119, + "line": 1, + "offset": 118, + }, + "error": "/content/0:heading/attrs/level: maximum should be <= 6", + "path": "/content/0/attrs/level", + "start": Object { + "column": 118, + "line": 1, + "offset": 117, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'heading-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 76, + "line": 1, + "offset": 75, + }, + "error": "/content/0:heading Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, + Object { + "end": Object { + "column": 76, + "line": 1, + "offset": 75, + }, + "error": "/content/0:heading Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 76, + "line": 1, + "offset": 75, + }, + "error": "/content/0:heading Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, + Object { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "error": "/content/0:heading Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + }, + Object { + "end": Object { + "column": 76, + "line": 1, + "offset": 75, + }, + "error": "/content/0:heading Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "error": "/content/0:heading Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "error": "/content/0:heading Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 96, + "line": 1, + "offset": 95, + }, + "error": "/content/0:heading Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + }, + Object { + "end": Object { + "column": 100, + "line": 1, + "offset": 99, + }, + "error": "/content/0:heading: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'heading-with-non-text-block.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 81, + "line": 1, + "offset": 80, + }, + "error": "/content/0:heading/content/0:rule/type should be equal to one of the allowed values: hardBreak, emoji, mention, inlineExtension, date, placeholder, text, text", + "path": "/content/0/content/0/type", + "start": Object { + "column": 75, + "line": 1, + "offset": 74, + }, + "suggestion": "Did you mean date?", + }, +] +`; + +exports[`Integration Test - shows better error for 'heading-with-non-text-inline.json 1`] = ` +Array [ + Object { + "error": "/content/0:heading/content/0:emoji/attrs should have required property 'shortName'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'heading-with-unknown-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 125, + "line": 1, + "offset": 124, + }, + "error": "/content/0:heading/attrs Property foo is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'heading-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:heading should have required property 'attrs'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'inlineExtension-with-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, + Object { + "end": Object { + "column": 102, + "line": 1, + "offset": 101, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 95, + "line": 1, + "offset": 94, + }, + }, + Object { + "end": Object { + "column": 102, + "line": 1, + "offset": 101, + }, + "error": "/content/0:paragraph/content/0:inlineExtension Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 95, + "line": 1, + "offset": 94, + }, + }, + Object { + "end": Object { + "column": 224, + "line": 1, + "offset": 223, + }, + "error": "/content/0:paragraph/content/0:inlineExtension: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'inlineExtension-without-extensionKey.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:inlineExtension/attrs should have required property 'extensionKey'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 103, + "line": 1, + "offset": 102, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'inlineExtension-without-extensionType.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:inlineExtension/attrs should have required property 'extensionType'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 103, + "line": 1, + "offset": 102, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'link-with-empty-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:link/attrs should have required property 'href'", + "path": "/content/0/content/0/marks/0/attrs", + "start": Object { + "column": 129, + "line": 1, + "offset": 128, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'link-with-unknown-attr.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:link/attrs should have required property 'href'", + "path": "/content/0/content/0/marks/0/attrs", + "start": Object { + "column": 129, + "line": 1, + "offset": 128, + }, + }, +] +`; + exports[`Integration Test - shows better error for 'link-without-attrs.json 1`] = ` Array [ Object { - "error": "/content/0:paragraph/content/0:text/marks/0:link should have required property 'attrs'", + "error": "/content/0:paragraph/content/0:text/marks/0:link should have required property 'attrs'", + "path": "/content/0/content/0/marks/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'list-with-blockquote.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 121, + "line": 1, + "offset": 120, + }, + "error": "/content/0:orderedList/content/0:listItem/content/0:blockquote/type should be equal to one of the allowed values: mediaSingle", + "path": "/content/0/content/0/content/0/type", + "start": Object { + "column": 109, + "line": 1, + "offset": 108, + }, + "suggestion": "Did you mean mediaSingle?", + }, +] +`; + +exports[`Integration Test - shows better error for 'list-with-codeBlock.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + "error": "/content/0:orderedList/content/0:listItem/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 134, + "line": 1, + "offset": 133, + }, + }, + Object { + "end": Object { + "column": 175, + "line": 1, + "offset": 174, + }, + "error": "/content/0:orderedList/content/0:listItem/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 168, + "line": 1, + "offset": 167, + }, + }, + Object { + "end": Object { + "column": 179, + "line": 1, + "offset": 178, + }, + "error": "/content/0:orderedList/content/0:listItem/content/0:codeBlock: anyOf should match some schema in anyOf", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 101, + "line": 1, + "offset": 100, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'listItem-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 170, + "line": 1, + "offset": 169, + }, + "error": "/content/0:bulletList/content/0:listItem Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 163, + "line": 1, + "offset": 162, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'listItem-with-empty-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 101, + "line": 1, + "offset": 100, + }, + "error": "/content/0:bulletList/content/0:listItem/content: minItems should NOT have less than 1 items", + "path": "/content/0/content/0/content", + "start": Object { + "column": 99, + "line": 1, + "offset": 98, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'listItem-with-list-as-first-child.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 121, + "line": 1, + "offset": 120, + }, + "error": "/content/0:orderedList/content/0:listItem/content/0:bulletList/type should be equal to one of the allowed values: paragraph, mediaSingle", + "path": "/content/0/content/0/content/0/type", + "start": Object { + "column": 109, + "line": 1, + "offset": 108, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'listItem-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 170, + "line": 1, + "offset": 169, + }, + "error": "/content/0:bulletList/content/0:listItem Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 163, + "line": 1, + "offset": 162, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-as-top-level-node.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "error": "/content/0:media/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, applicationCard, decisionList, taskList, extension, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "suggestion": "Did you mean heading?", + }, +] +`; + +exports[`Integration Test - shows better error for 'media-with-empty-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:mediaGroup/content/0:media/attrs should have required property 'type'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-with-invalid-occurrence-key-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 171, + "line": 1, + "offset": 170, + }, + "error": "/content/0:mediaGroup/content/0:media/attrs/occurrenceKey: minLength should NOT be shorter than 1 characters", + "path": "/content/0/content/0/attrs/occurrenceKey", + "start": Object { + "column": 169, + "line": 1, + "offset": 168, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 129, + "line": 1, + "offset": 128, + }, + "error": "/content/0:mediaGroup/content/0:media Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 122, + "line": 1, + "offset": 121, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-with-unknown-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 126, + "line": 1, + "offset": 125, + }, + "error": "/content/0:mediaGroup/content/0:media/attrs Property foo is not expected to be here", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 121, + "line": 1, + "offset": 120, + }, + }, + Object { + "end": Object { + "column": 113, + "line": 1, + "offset": 112, + }, + "error": "/content/0:mediaGroup/content/0:media/attrs Property id is not expected to be here", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 109, + "line": 1, + "offset": 108, + }, + }, + Object { + "end": Object { + "column": 133, + "line": 1, + "offset": 132, + }, + "error": "/content/0:mediaGroup/content/0:media/attrs: anyOf should match some schema in anyOf", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:mediaGroup/content/0:media should have required property 'attrs'", + "path": "/content/0/content/0", + "start": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-without-id-attr.json 1`] = ` +Array [ + Object { + "error": "/content/0:mediaGroup/content/0:media/attrs should have required property 'id'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'media-without-type-attr.json 1`] = ` +Array [ + Object { + "error": "/content/0:mediaGroup/content/0:media/attrs should have required property 'type'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaGroup-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "error": "/content/0:mediaGroup/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "suggestion": "Did you mean mediaSingle?", + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaGroup-with-empty-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + "error": "/content/0:mediaGroup/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaGroup-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:mediaGroup Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:mediaGroup Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "error": "/content/0:mediaGroup Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 59, + "line": 1, + "offset": 58, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + "error": "/content/0:mediaGroup Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 124, + "line": 1, + "offset": 123, + }, + }, + Object { + "end": Object { + "column": 135, + "line": 1, + "offset": 134, + }, + "error": "/content/0:mediaGroup: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaGroup-without-content.json 1`] = ` +Array [ + Object { + "error": "/content/0:mediaGroup should have required property 'content'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaSingle-with-empty-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 83, + "line": 1, + "offset": 82, + }, + "error": "/content/0:mediaSingle/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 81, + "line": 1, + "offset": 80, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaSingle-with-empty-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 72, + "line": 1, + "offset": 71, + }, + "error": "/content/0:mediaSingle/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 70, + "line": 1, + "offset": 69, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mediaSingle-with-invalid-layout-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 207, + "line": 1, + "offset": 206, + }, + "error": "/content/1:mediaSingle/type should be equal to one of the allowed values: orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", + "path": "/content/1/type", + "start": Object { + "column": 194, + "line": 1, + "offset": 193, + }, + "suggestion": "Did you mean heading?", + }, +] +`; + +exports[`Integration Test - shows better error for 'mention-with-extra-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 140, + "line": 1, + "offset": 139, + }, + "error": "/content/0:paragraph/content/0:mention/attrs Property eyeColor is not expected to be here", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 130, + "line": 1, + "offset": 129, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mention-with-invalid-user-type.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:mention/attrs/userType should be equal to one of the allowed values: DEFAULT, SPECIAL, APP", + "path": "/content/0/content/0/attrs/userType", + "start": Object { + "column": 139, + "line": 1, + "offset": 138, + }, + "suggestion": "Did you mean SPECIAL?", + }, +] +`; + +exports[`Integration Test - shows better error for 'mention-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, + Object { + "end": Object { + "column": 138, + "line": 1, + "offset": 137, + }, + "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, + Object { + "end": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + "error": "/content/0:paragraph/content/0:mention Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 87, + "line": 1, + "offset": 86, + }, + }, + Object { + "end": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + "error": "/content/0:paragraph/content/0:mention Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 87, + "line": 1, + "offset": 86, + }, + }, + Object { + "end": Object { + "column": 142, + "line": 1, + "offset": 141, + }, + "error": "/content/0:paragraph/content/0:mention: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mention-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:mention should have required property 'attrs'", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'mono-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 120, + "line": 1, + "offset": 119, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:mono/type should be equal to one of the allowed values: link, subsup, textColor, action, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + "suggestion": "Did you mean link?", + }, +] +`; + +exports[`Integration Test - shows better error for 'orderedList-with-extra-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 256, + "line": 1, + "offset": 255, + }, + "error": "/content/0:orderedList/attrs Property reverse is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 247, + "line": 1, + "offset": 246, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'orderedList-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 235, + "line": 1, + "offset": 234, + }, + "error": "/content/0:orderedList Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 228, + "line": 1, + "offset": 227, + }, + }, + Object { + "end": Object { + "column": 235, + "line": 1, + "offset": 234, + }, + "error": "/content/0:orderedList Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 228, + "line": 1, + "offset": 227, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 235, + "line": 1, + "offset": 234, + }, + "error": "/content/0:orderedList Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 228, + "line": 1, + "offset": 227, + }, + }, + Object { + "end": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + "error": "/content/0:orderedList Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + }, + Object { + "end": Object { + "column": 235, + "line": 1, + "offset": 234, + }, + "error": "/content/0:orderedList Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 228, + "line": 1, + "offset": 227, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + "error": "/content/0:orderedList Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + "error": "/content/0:orderedList Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 255, + "line": 1, + "offset": 254, + }, + "error": "/content/0:orderedList Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 248, + "line": 1, + "offset": 247, + }, + }, + Object { + "end": Object { + "column": 259, + "line": 1, + "offset": 258, + }, + "error": "/content/0:orderedList: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'orderedList-without-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 102, + "line": 1, + "offset": 101, + }, + "error": "/content/0:orderedList/content/0:listItem/content: minItems should NOT have less than 1 items", + "path": "/content/0/content/0/content", + "start": Object { + "column": 100, + "line": 1, + "offset": 99, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-with-blockquote.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 85, + "line": 1, + "offset": 84, + }, + "error": "/content/0:panel/content/0:blockquote/type should be equal to one of the allowed values: orderedList, heading", + "path": "/content/0/content/0/type", + "start": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-with-codeBlock.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + "error": "/content/0:panel/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + }, + Object { + "end": Object { + "column": 105, + "line": 1, + "offset": 104, + }, + "error": "/content/0:panel/content/0:codeBlock Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + }, + Object { + "end": Object { + "column": 139, + "line": 1, + "offset": 138, + }, + "error": "/content/0:panel/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 132, + "line": 1, + "offset": 131, + }, + }, + Object { + "end": Object { + "column": 139, + "line": 1, + "offset": 138, + }, + "error": "/content/0:panel/content/0:codeBlock Property marks is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 132, + "line": 1, + "offset": 131, + }, + }, + Object { + "end": Object { + "column": 143, + "line": 1, + "offset": 142, + }, + "error": "/content/0:panel/content/0:codeBlock: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-with-empty-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:panel/attrs should have required property 'panelType'", + "path": "/content/0/attrs", + "start": Object { + "column": 136, + "line": 1, + "offset": 135, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 135, + "line": 1, + "offset": 134, + }, + "error": "/content/0:panel Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 128, + "line": 1, + "offset": 127, + }, + }, + Object { + "end": Object { + "column": 135, + "line": 1, + "offset": 134, + }, + "error": "/content/0:panel Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 128, + "line": 1, + "offset": 127, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 135, + "line": 1, + "offset": 134, + }, + "error": "/content/0:panel Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 128, + "line": 1, + "offset": 127, + }, + }, + Object { + "end": Object { + "column": 63, + "line": 1, + "offset": 62, + }, + "error": "/content/0:panel Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + }, + Object { + "end": Object { + "column": 135, + "line": 1, + "offset": 134, + }, + "error": "/content/0:panel Property attrs is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 128, + "line": 1, + "offset": 127, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 63, + "line": 1, + "offset": 62, + }, + "error": "/content/0:panel Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 63, + "line": 1, + "offset": 62, + }, + "error": "/content/0:panel Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 164, + "line": 1, + "offset": 163, + }, + "error": "/content/0:panel Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 157, + "line": 1, + "offset": 156, + }, + }, + Object { + "end": Object { + "column": 168, + "line": 1, + "offset": 167, + }, + "error": "/content/0:panel: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-with-panel.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 80, + "line": 1, + "offset": 79, + }, + "error": "/content/0:panel/content/0:panel/type should be equal to one of the allowed values: orderedList, heading", + "path": "/content/0/content/0/type", + "start": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "suggestion": "Did you mean heading?", + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-with-unknown-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 161, + "line": 1, + "offset": 160, + }, + "error": "/content/0:panel/attrs Property foo is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 156, + "line": 1, + "offset": 155, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'panel-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:panel should have required property 'attrs'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'paragraph-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 67, + "line": 1, + "offset": 66, + }, + "error": "/content/0:paragraph Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 67, + "line": 1, + "offset": 66, + }, + "error": "/content/0:paragraph Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 67, + "line": 1, + "offset": 66, + }, + "error": "/content/0:paragraph Property content is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 78, + "line": 1, + "offset": 77, + }, + "error": "/content/0:paragraph Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 71, + "line": 1, + "offset": 70, + }, + }, + Object { + "end": Object { + "column": 82, + "line": 1, + "offset": 81, + }, + "error": "/content/0:paragraph: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'paragraph-with-text-with-unknown-mark.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 127, + "line": 1, + "offset": 126, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:__unknown__/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action, code, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'paragraph-with-top-level-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 83, + "line": 1, + "offset": 82, + }, + "error": "/content/0:paragraph/content/0:rule/type should be equal to one of the allowed values: hardBreak, emoji, mention, inlineExtension, date, placeholder, text, text", + "path": "/content/0/content/0/type", + "start": Object { + "column": 77, + "line": 1, + "offset": 76, + }, + "suggestion": "Did you mean date?", + }, +] +`; + +exports[`Integration Test - shows better error for 'paragraph-without-content.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph should have required property 'content'", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'placeholder-with-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + }, + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + }, + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + }, + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + }, + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + }, + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 141, + "line": 1, + "offset": 140, + }, + }, + Object { + "end": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + "error": "/content/0:paragraph/content/0:placeholder Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, + Object { + "end": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + "error": "/content/0:paragraph/content/0:placeholder Property attrs is not expected to be here", + "path": "/content/0/content/0", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, + Object { + "end": Object { + "column": 187, + "line": 1, + "offset": 186, + }, + "error": "/content/0:paragraph/content/0:placeholder: anyOf should match some schema in anyOf", + "path": "/content/0/content/0", + "start": Object { + "column": 69, + "line": 1, + "offset": 68, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'placeholder-with-empty-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:placeholder/attrs should have required property 'text'", + "path": "/content/0/content/0/attrs", + "start": Object { + "column": 99, + "line": 1, + "offset": 98, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'rule-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 52, + "line": 1, + "offset": 51, + }, + "error": "/content/0:rule/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, applicationCard, decisionList, taskList, extension, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "suggestion": "Did you mean table?", + }, +] +`; + +exports[`Integration Test - shows better error for 'rule-with-content.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 52, + "line": 1, + "offset": 51, + }, + "error": "/content/0:rule/type should be equal to one of the allowed values: paragraph, bulletList, mediaSingle, orderedList, heading, panel, blockquote, mediaGroup, table, decisionList, taskList, bodiedExtension, codeBlock", + "path": "/content/0/type", + "start": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "suggestion": "Did you mean table?", + }, +] +`; + +exports[`Integration Test - shows better error for 'rule-with-marks.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 60, + "line": 1, + "offset": 59, + }, + "error": "/content/0:rule Property marks is not expected to be here", + "path": "/content/0", + "start": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + }, + Object { + "end": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + "error": "/content/0:rule: anyOf should match some schema in anyOf", + "path": "/content/0", + "start": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'strike-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 122, + "line": 1, + "offset": 121, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:strike/type should be equal to one of the allowed values: link, subsup, textColor, action, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'strong-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 122, + "line": 1, + "offset": 121, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:strong/type should be equal to one of the allowed values: link, subsup, textColor, action, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + "suggestion": "Did you mean action?", + }, +] +`; + +exports[`Integration Test - shows better error for 'subsup-with-extra-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 150, + "line": 1, + "offset": 149, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:subsup/attrs Property foo is not expected to be here", + "path": "/content/0/content/0/marks/0/attrs", + "start": Object { + "column": 145, + "line": 1, + "offset": 144, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'subsup-with-invalid-type-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 144, + "line": 1, + "offset": 143, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:subsup/attrs/type should be equal to one of the allowed values: sub, sup", + "path": "/content/0/content/0/marks/0/attrs/type", + "start": Object { + "column": 139, + "line": 1, + "offset": 138, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'subsup-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:subsup should have required property 'attrs'", + "path": "/content/0/content/0/marks/0", + "start": Object { + "column": 106, + "line": 1, + "offset": 105, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'subsup-without-type-attr.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:subsup/attrs should have required property 'type'", + "path": "/content/0/content/0/marks/0/attrs", + "start": Object { + "column": 131, + "line": 1, + "offset": 130, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'table-with-nested-table.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 362, + "line": 1, + "offset": 361, + }, + "error": "/content/0:table/content/0:tableRow/content: anyOf should match some schema in anyOf", + "path": "/content/0/content/0/content", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'table-without-cells.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + "error": "/content/0:table/content/0:tableRow/content: type should be array", + "path": "/content/0/content/0/content", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, + Object { + "end": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + "error": "/content/0:table/content/0:tableRow/content: type should be array", + "path": "/content/0/content/0/content", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, + Object { + "end": Object { + "column": 98, + "line": 1, + "offset": 97, + }, + "error": "/content/0:table/content/0:tableRow/content: anyOf should match some schema in anyOf", + "path": "/content/0/content/0/content", + "start": Object { + "column": 94, + "line": 1, + "offset": 93, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'table-without-rows.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 66, + "line": 1, + "offset": 65, + }, + "error": "/content/0:table/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 64, + "line": 1, + "offset": 63, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'task-with-blockquote.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 208, + "line": 1, + "offset": 207, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 199, + "line": 1, + "offset": 198, + }, + }, + Object { + "end": Object { + "column": 227, + "line": 1, + "offset": 226, + }, + "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote: anyOf should match some schema in anyOf", + "path": "/content/0/content/0/content/0", + "start": Object { + "column": 178, + "line": 1, + "offset": 177, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'task-with-invalid-state.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 165, + "line": 1, + "offset": 164, + }, + "error": "/content/0:taskList/content/0:taskItem/attrs/state should be equal to one of the allowed values: TODO, DONE", + "path": "/content/0/content/0/attrs/state", + "start": Object { + "column": 159, + "line": 1, + "offset": 158, + }, + "suggestion": "Did you mean DONE?", + }, +] +`; + +exports[`Integration Test - shows better error for 'taskList-with-empty-task.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "error": "/content/0:taskList/attrs Property order is not expected to be here", + "path": "/content/0/attrs", + "start": Object { + "column": 66, + "line": 1, + "offset": 65, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'taskList-with-no-task.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 89, + "line": 1, + "offset": 88, + }, + "error": "/content/0:taskList/content: minItems should NOT have less than 1 items", + "path": "/content/0/content", + "start": Object { + "column": 87, + "line": 1, + "offset": 86, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'text-empty.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 93, + "line": 1, + "offset": 92, + }, + "error": "/content/0:paragraph/content/0:text/text: minLength should NOT be shorter than 1 characters", + "path": "/content/0/content/0/text", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, + Object { + "end": Object { + "column": 93, + "line": 1, + "offset": 92, + }, + "error": "/content/0:paragraph/content/0:text/text: minLength should NOT be shorter than 1 characters", + "path": "/content/0/content/0/text", + "start": Object { + "column": 91, + "line": 1, + "offset": 90, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'textColor-with-extra-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 158, + "line": 1, + "offset": 157, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:textColor/attrs Property foo is not expected to be here", + "path": "/content/0/content/0/marks/0/attrs", + "start": Object { + "column": 153, + "line": 1, + "offset": 152, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'textColor-with-invalid-color-attr.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 152, + "line": 1, + "offset": 151, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:textColor/attrs/color: pattern should match pattern \\"^#[0-9a-f]{6}$\\"", + "path": "/content/0/content/0/marks/0/attrs/color", + "start": Object { + "column": 143, + "line": 1, + "offset": 142, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'textColor-without-attrs.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:textColor should have required property 'attrs'", "path": "/content/0/content/0/marks/0", "start": Object { "column": 106, @@ -13,3 +5588,36 @@ Array [ }, ] `; + +exports[`Integration Test - shows better error for 'textColor-without-color-attr.json 1`] = ` +Array [ + Object { + "error": "/content/0:paragraph/content/0:text/marks/0:textColor/attrs should have required property 'color'", + "path": "/content/0/content/0/marks/0/attrs", + "start": Object { + "column": 134, + "line": 1, + "offset": 133, + }, + }, +] +`; + +exports[`Integration Test - shows better error for 'underline-with-attrs.json 1`] = ` +Array [ + Object { + "end": Object { + "column": 125, + "line": 1, + "offset": 124, + }, + "error": "/content/0:paragraph/content/0:text/marks/0:underline/type should be equal to one of the allowed values: link, subsup, textColor, action, link", + "path": "/content/0/content/0/marks/0/type", + "start": Object { + "column": 114, + "line": 1, + "offset": 113, + }, + }, +] +`; diff --git a/src/__tests__/integration/invalid/applicationCard-with-additional-properties.json b/src/__tests__/integration/invalid/applicationCard-with-additional-properties.json new file mode 100644 index 00000000..4b38f4e2 --- /dev/null +++ b/src/__tests__/integration/invalid/applicationCard-with-additional-properties.json @@ -0,0 +1,83 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "applicationCard", + "attrs": { + "text": "foo", + "text2": "foo", + "textUrl": "https://www.atlassian.com", + "link": { + "url": "https://www.atlassian.com" + }, + "background": { + "url": "https://www.atlassian.com" + }, + "collapsible": true, + "preview": { + "url": "https://www.atlassian.com" + }, + "title": { + "text": "foo", + "user": { + "id": "id", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + }, + "description": { + "text": "foo" + }, + "details": [ + { + "title": "foo", + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + }, + "badge": { + "value": 9, + "max": 10, + "theme": "dark", + "appearance": "removed" + }, + "lozenge": { + "text": "foo", + "bold": true, + "appearance": "default" + }, + "users": [ + { + "id": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + }, + { + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + ] + }, + { + "title": "bar" + } + ], + "context": { + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + } + } + ] +} diff --git a/src/__tests__/integration/invalid/applicationCard-with-wrong-details.json b/src/__tests__/integration/invalid/applicationCard-with-wrong-details.json new file mode 100644 index 00000000..f5e6bcf0 --- /dev/null +++ b/src/__tests__/integration/invalid/applicationCard-with-wrong-details.json @@ -0,0 +1,82 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "applicationCard", + "attrs": { + "text": "foo", + "textUrl": "https://www.atlassian.com", + "link": { + "url": "https://www.atlassian.com" + }, + "background": { + "url": "https://www.atlassian.com" + }, + "collapsible": true, + "preview": { + "url": "https://www.atlassian.com" + }, + "title": { + "text": "foo", + "user": { + "id": "id", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + }, + "description": { + "text": "foo" + }, + "details": [ + { + "title": "foo", + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + }, + "badge": { + "value": 9, + "max": 10, + "theme": "dark2", + "appearance": "removed2" + }, + "lozenge": { + "text": "foo", + "bold": true, + "appearance": "default2" + }, + "users": [ + { + "id": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + }, + { + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + ] + }, + { + "title": "bar" + } + ], + "context": { + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + } + } + ] +} diff --git a/src/__tests__/integration/invalid/applicationCard-with-wrong-link.json b/src/__tests__/integration/invalid/applicationCard-with-wrong-link.json new file mode 100644 index 00000000..15240701 --- /dev/null +++ b/src/__tests__/integration/invalid/applicationCard-with-wrong-link.json @@ -0,0 +1,80 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "applicationCard", + "attrs": { + "text": "foo", + "textUrl": "https://www.atlassian.com", + "link": "https://www.atlassian.com", + "background": { + "url": "https://www.atlassian.com" + }, + "collapsible": true, + "preview": { + "url": "https://www.atlassian.com" + }, + "title": { + "text": "foo", + "user": { + "id": "id", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + }, + "description": { + "text": "foo" + }, + "details": [ + { + "title": "foo", + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + }, + "badge": { + "value": 9, + "max": 10, + "theme": "dark", + "appearance": "removed" + }, + "lozenge": { + "text": "foo", + "bold": true, + "appearance": "default" + }, + "users": [ + { + "id": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + }, + { + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + ] + }, + { + "title": "bar" + } + ], + "context": { + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + } + } + ] +} diff --git a/src/__tests__/integration/invalid/applicationCard-with-wrong-title.json b/src/__tests__/integration/invalid/applicationCard-with-wrong-title.json new file mode 100644 index 00000000..4fa117b2 --- /dev/null +++ b/src/__tests__/integration/invalid/applicationCard-with-wrong-title.json @@ -0,0 +1,81 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "applicationCard", + "attrs": { + "text": "foo", + "textUrl": "https://www.atlassian.com", + "link": { + "url": "https://www.atlassian.com" + }, + "background": { + "url": "https://www.atlassian.com" + }, + "collapsible": true, + "preview": { + "url": "https://www.atlassian.com" + }, + "title": { + "user": { + "id": "id", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + }, + "description": { + "text": "foo" + }, + "details": [ + { + "title": "foo", + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + }, + "badge": { + "value": 9, + "max": 10, + "theme": "dark", + "appearance": "removed" + }, + "lozenge": { + "text": "foo", + "bold": true, + "appearance": "default" + }, + "users": [ + { + "id": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + }, + { + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + ] + }, + { + "title": "bar" + } + ], + "context": { + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + } + } + ] +} diff --git a/src/__tests__/integration/invalid/applicationCard-without-attrs-text.json b/src/__tests__/integration/invalid/applicationCard-without-attrs-text.json new file mode 100644 index 00000000..abbd4bfd --- /dev/null +++ b/src/__tests__/integration/invalid/applicationCard-without-attrs-text.json @@ -0,0 +1,82 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "applicationCard", + "text": "foo", + "attrs": { + "textUrl": "https://www.atlassian.com", + "link": { + "url": "https://www.atlassian.com" + }, + "background": { + "url": "https://www.atlassian.com" + }, + "collapsible": true, + "preview": { + "url": "https://www.atlassian.com" + }, + "title": { + "text": "foo", + "user": { + "id": "id", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + }, + "description": { + "text": "foo" + }, + "details": [ + { + "title": "foo", + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + }, + "badge": { + "value": 9, + "max": 10, + "theme": "dark", + "appearance": "removed" + }, + "lozenge": { + "text": "foo", + "bold": true, + "appearance": "default" + }, + "users": [ + { + "id": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + }, + { + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + ] + }, + { + "title": "bar" + } + ], + "context": { + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + } + } + ] +} diff --git a/src/__tests__/integration/invalid/applicationCard-without-link-url.json b/src/__tests__/integration/invalid/applicationCard-without-link-url.json new file mode 100644 index 00000000..fa459877 --- /dev/null +++ b/src/__tests__/integration/invalid/applicationCard-without-link-url.json @@ -0,0 +1,80 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "applicationCard", + "attrs": { + "text": "foo", + "textUrl": "https://www.atlassian.com", + "link": {}, + "background": { + "url": "https://www.atlassian.com" + }, + "collapsible": true, + "preview": { + "url": "https://www.atlassian.com" + }, + "title": { + "text": "foo", + "user": { + "id": "id", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + }, + "description": { + "text": "foo" + }, + "details": [ + { + "title": "foo", + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + }, + "badge": { + "value": 9, + "max": 10, + "theme": "dark", + "appearance": "removed" + }, + "lozenge": { + "text": "foo", + "bold": true, + "appearance": "default" + }, + "users": [ + { + "id": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + }, + { + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + ] + }, + { + "title": "bar" + } + ], + "context": { + "text": "foo", + "icon": { + "url": "https://www.atlassian.com", + "label": "foo" + } + } + } + } + ] +} diff --git a/src/__tests__/integration/invalid/blockQuote-with-attrs.json b/src/__tests__/integration/invalid/blockQuote-with-attrs.json new file mode 100644 index 00000000..b97a816b --- /dev/null +++ b/src/__tests__/integration/invalid/blockQuote-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ] +} diff --git a/src/__tests__/integration/invalid/blockQuote-with-empty-content.json b/src/__tests__/integration/invalid/blockQuote-with-empty-content.json new file mode 100644 index 00000000..f51aa3f9 --- /dev/null +++ b/src/__tests__/integration/invalid/blockQuote-with-empty-content.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "blockquote", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/blockQuote-with-marks.json b/src/__tests__/integration/invalid/blockQuote-with-marks.json new file mode 100644 index 00000000..4c55136d --- /dev/null +++ b/src/__tests__/integration/invalid/blockQuote-with-marks.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/blockQuote-without-content.json b/src/__tests__/integration/invalid/blockQuote-without-content.json new file mode 100644 index 00000000..c447dadd --- /dev/null +++ b/src/__tests__/integration/invalid/blockQuote-without-content.json @@ -0,0 +1,9 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "blockquote" + } + ] +} diff --git a/src/__tests__/integration/invalid/blockquote-with-list-inside.json b/src/__tests__/integration/invalid/blockquote-with-list-inside.json new file mode 100644 index 00000000..7fd96f6c --- /dev/null +++ b/src/__tests__/integration/invalid/blockquote-with-list-inside.json @@ -0,0 +1,30 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json b/src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json new file mode 100644 index 00000000..f92b0ba1 --- /dev/null +++ b/src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json @@ -0,0 +1,28 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bodiedExtension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro.core", + "extensionKey": "expand" + }, + "content": [ + { + "type": "bodiedExtension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro.core", + "extensionKey": "expand" + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/bodied-extension-without-content.json b/src/__tests__/integration/invalid/bodied-extension-without-content.json new file mode 100644 index 00000000..36b12853 --- /dev/null +++ b/src/__tests__/integration/invalid/bodied-extension-without-content.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bodiedExtension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro", + "extensionKey": "expand" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json b/src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json new file mode 100644 index 00000000..67f5d122 --- /dev/null +++ b/src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bodiedExtension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro" + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/bodied-extension-without-extensionType.json b/src/__tests__/integration/invalid/bodied-extension-without-extensionType.json new file mode 100644 index 00000000..4406b0af --- /dev/null +++ b/src/__tests__/integration/invalid/bodied-extension-without-extensionType.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bodiedExtension", + "attrs": { + "extensionKey": "expand" + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/bulletList-with-attrs.json b/src/__tests__/integration/invalid/bulletList-with-attrs.json new file mode 100644 index 00000000..db0d7a32 --- /dev/null +++ b/src/__tests__/integration/invalid/bulletList-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ] +} diff --git a/src/__tests__/integration/invalid/bulletList-with-empty-content.json b/src/__tests__/integration/invalid/bulletList-with-empty-content.json new file mode 100644 index 00000000..3ea2462f --- /dev/null +++ b/src/__tests__/integration/invalid/bulletList-with-empty-content.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/bulletList-with-marks.json b/src/__tests__/integration/invalid/bulletList-with-marks.json new file mode 100644 index 00000000..e6474c2e --- /dev/null +++ b/src/__tests__/integration/invalid/bulletList-with-marks.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ], + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json b/src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json new file mode 100644 index 00000000..81661ec6 --- /dev/null +++ b/src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/bulletList-without-content.json b/src/__tests__/integration/invalid/bulletList-without-content.json new file mode 100644 index 00000000..1f45abd9 --- /dev/null +++ b/src/__tests__/integration/invalid/bulletList-without-content.json @@ -0,0 +1,9 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList" + } + ] +} diff --git a/src/__tests__/integration/invalid/code-and-em.json b/src/__tests__/integration/invalid/code-and-em.json new file mode 100644 index 00000000..3cc3bdbe --- /dev/null +++ b/src/__tests__/integration/invalid/code-and-em.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "code" + }, + { + "type": "em" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/code-and-strike.json b/src/__tests__/integration/invalid/code-and-strike.json new file mode 100644 index 00000000..7c733be1 --- /dev/null +++ b/src/__tests__/integration/invalid/code-and-strike.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "code" + }, + { + "type": "strike" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/code-and-strong.json b/src/__tests__/integration/invalid/code-and-strong.json new file mode 100644 index 00000000..9a3df022 --- /dev/null +++ b/src/__tests__/integration/invalid/code-and-strong.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "code" + }, + { + "type": "strong" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/code-and-subsup.json b/src/__tests__/integration/invalid/code-and-subsup.json new file mode 100644 index 00000000..db35bd34 --- /dev/null +++ b/src/__tests__/integration/invalid/code-and-subsup.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "code" + }, + { + "type": "subsup" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/code-and-underline.json b/src/__tests__/integration/invalid/code-and-underline.json new file mode 100644 index 00000000..a51b75f7 --- /dev/null +++ b/src/__tests__/integration/invalid/code-and-underline.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "code" + }, + { + "type": "underline" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/code-with-attrs.json b/src/__tests__/integration/invalid/code-with-attrs.json new file mode 100644 index 00000000..ed05d7d4 --- /dev/null +++ b/src/__tests__/integration/invalid/code-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "code", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/codeBlock-with-marks.json b/src/__tests__/integration/invalid/codeBlock-with-marks.json new file mode 100644 index 00000000..43859ad3 --- /dev/null +++ b/src/__tests__/integration/invalid/codeBlock-with-marks.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "codeBlock", + "content": [], + "attrs": { + "language": "javascript" + }, + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/codeBlock-with-non-text.json b/src/__tests__/integration/invalid/codeBlock-with-non-text.json new file mode 100644 index 00000000..eca264e5 --- /dev/null +++ b/src/__tests__/integration/invalid/codeBlock-with-non-text.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "codeBlock", + "content": [ + { + "type": "rule" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/codeBlock-with-strong.json b/src/__tests__/integration/invalid/codeBlock-with-strong.json new file mode 100644 index 00000000..c51b6e91 --- /dev/null +++ b/src/__tests__/integration/invalid/codeBlock-with-strong.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "codeBlock", + "content": [ + { + "type": "text", + "marks": [ + { + "type": "strong" + } + ], + "text": "foo" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json b/src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json new file mode 100644 index 00000000..2ac4cc45 --- /dev/null +++ b/src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "codeBlock", + "content": [], + "attrs": { + "language": "foo" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/codeBlock-with-unknown-language.json b/src/__tests__/integration/invalid/codeBlock-with-unknown-language.json new file mode 100644 index 00000000..651a0e43 --- /dev/null +++ b/src/__tests__/integration/invalid/codeBlock-with-unknown-language.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "codeBlock", + "content": [], + "attrs": { + "foo": "bar" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/decision-with-blockquote.json b/src/__tests__/integration/invalid/decision-with-blockquote.json new file mode 100644 index 00000000..a01193f2 --- /dev/null +++ b/src/__tests__/integration/invalid/decision-with-blockquote.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "decisionList", + "attrs": { + "localId": "test-list-id" + }, + "content": [ + { + "type": "decisionItem", + "attrs": { + "localId": "test-id", + "state": "DECIDED" + }, + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "rule" + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/decisionList-with-empty-decision.json b/src/__tests__/integration/invalid/decisionList-with-empty-decision.json new file mode 100644 index 00000000..073a2bb4 --- /dev/null +++ b/src/__tests__/integration/invalid/decisionList-with-empty-decision.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "decisionList", + "attrs": { + "order": 1, + "localId": "test-list-id" + }, + "content": [ + { + "type": "decisionItem", + "attrs": { + "localId": "test-id", + "state": "DECIDED" + }, + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/decisionList-with-no-decision.json b/src/__tests__/integration/invalid/decisionList-with-no-decision.json new file mode 100644 index 00000000..2e4e2066 --- /dev/null +++ b/src/__tests__/integration/invalid/decisionList-with-no-decision.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "decisionList", + "attrs": { + "order": 1 + }, + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/doc-with-attrs.json b/src/__tests__/integration/invalid/doc-with-attrs.json new file mode 100644 index 00000000..871d66ae --- /dev/null +++ b/src/__tests__/integration/invalid/doc-with-attrs.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "rule" + } + ], + "attrs": {} +} diff --git a/src/__tests__/integration/invalid/doc-with-empty-content.json b/src/__tests__/integration/invalid/doc-with-empty-content.json new file mode 100644 index 00000000..88e66459 --- /dev/null +++ b/src/__tests__/integration/invalid/doc-with-empty-content.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "type": "doc", + "content": [] +} diff --git a/src/__tests__/integration/invalid/doc-with-marks.json b/src/__tests__/integration/invalid/doc-with-marks.json new file mode 100644 index 00000000..f7927dd5 --- /dev/null +++ b/src/__tests__/integration/invalid/doc-with-marks.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "rule" + } + ], + "marks": [] +} diff --git a/src/__tests__/integration/invalid/doc-without-content.json b/src/__tests__/integration/invalid/doc-without-content.json new file mode 100644 index 00000000..342a90e6 --- /dev/null +++ b/src/__tests__/integration/invalid/doc-without-content.json @@ -0,0 +1,4 @@ +{ + "version": 1, + "type": "doc" +} diff --git a/src/__tests__/integration/invalid/doc-without-version.json b/src/__tests__/integration/invalid/doc-without-version.json new file mode 100644 index 00000000..5e1d6e4a --- /dev/null +++ b/src/__tests__/integration/invalid/doc-without-version.json @@ -0,0 +1,4 @@ +{ + "type": "doc", + "content": [] +} diff --git a/src/__tests__/integration/invalid/em-with-attrs.json b/src/__tests__/integration/invalid/em-with-attrs.json new file mode 100644 index 00000000..f4af7ba8 --- /dev/null +++ b/src/__tests__/integration/invalid/em-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "em", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/emoji-as-top-level-node.json b/src/__tests__/integration/invalid/emoji-as-top-level-node.json new file mode 100644 index 00000000..3ffdf796 --- /dev/null +++ b/src/__tests__/integration/invalid/emoji-as-top-level-node.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "emoji", + "attrs": { + "id": "1fd" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/emoji-with-content.json b/src/__tests__/integration/invalid/emoji-with-content.json new file mode 100644 index 00000000..e987205e --- /dev/null +++ b/src/__tests__/integration/invalid/emoji-with-content.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "emoji", + "attrs": { + "id": "1fd" + }, + "content": [ + { + "type": "text", + "text": "" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/emoji-with-empty-attrs.json b/src/__tests__/integration/invalid/emoji-with-empty-attrs.json new file mode 100644 index 00000000..737cc568 --- /dev/null +++ b/src/__tests__/integration/invalid/emoji-with-empty-attrs.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "emoji", + "attrs": {} + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/emoji-with-marks.json b/src/__tests__/integration/invalid/emoji-with-marks.json new file mode 100644 index 00000000..73c8c3d4 --- /dev/null +++ b/src/__tests__/integration/invalid/emoji-with-marks.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "emoji", + "attrs": { + "id": "1fd" + }, + "marks": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/emoji-with-unknown-attr.json b/src/__tests__/integration/invalid/emoji-with-unknown-attr.json new file mode 100644 index 00000000..95286529 --- /dev/null +++ b/src/__tests__/integration/invalid/emoji-with-unknown-attr.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "emoji", + "attrs": { + "id": "1fd", + "foo": "bar" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/emoji-without-attrs.json b/src/__tests__/integration/invalid/emoji-without-attrs.json new file mode 100644 index 00000000..6e25d700 --- /dev/null +++ b/src/__tests__/integration/invalid/emoji-without-attrs.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "emoji" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/extension-with-content.json b/src/__tests__/integration/invalid/extension-with-content.json new file mode 100644 index 00000000..f589c2d7 --- /dev/null +++ b/src/__tests__/integration/invalid/extension-with-content.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "extension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro", + "extensionKey": "gallery" + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/extension-without-extensionKey.json b/src/__tests__/integration/invalid/extension-without-extensionKey.json new file mode 100644 index 00000000..0c48a1c1 --- /dev/null +++ b/src/__tests__/integration/invalid/extension-without-extensionKey.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "extension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/extension-without-extensionType.json b/src/__tests__/integration/invalid/extension-without-extensionType.json new file mode 100644 index 00000000..535a1c21 --- /dev/null +++ b/src/__tests__/integration/invalid/extension-without-extensionType.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "extension", + "attrs": { + "extensionKey": "gallery" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/hardBreak-with-marks.json b/src/__tests__/integration/invalid/hardBreak-with-marks.json new file mode 100644 index 00000000..af3ce70c --- /dev/null +++ b/src/__tests__/integration/invalid/hardBreak-with-marks.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "hardBreak", + "attrs": { + "text": "\n" + }, + "marks": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/hardBreak-with-wrong-text.json b/src/__tests__/integration/invalid/hardBreak-with-wrong-text.json new file mode 100644 index 00000000..45add43b --- /dev/null +++ b/src/__tests__/integration/invalid/hardBreak-with-wrong-text.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "hardBreak", + "attrs": { + "text": "foo" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/heading-with-invalid-level-attr.json b/src/__tests__/integration/invalid/heading-with-invalid-level-attr.json new file mode 100644 index 00000000..15e1dc99 --- /dev/null +++ b/src/__tests__/integration/invalid/heading-with-invalid-level-attr.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "heading", + "content": [ + { + "type": "text", + "text": "Heading" + } + ], + "attrs": { + "level": 7 + } + } + ] +} diff --git a/src/__tests__/integration/invalid/heading-with-marks.json b/src/__tests__/integration/invalid/heading-with-marks.json new file mode 100644 index 00000000..38a16004 --- /dev/null +++ b/src/__tests__/integration/invalid/heading-with-marks.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "heading", + "content": [], + "attrs": { + "level": 1 + }, + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/heading-with-non-text-block.json b/src/__tests__/integration/invalid/heading-with-non-text-block.json new file mode 100644 index 00000000..8b6b0e2a --- /dev/null +++ b/src/__tests__/integration/invalid/heading-with-non-text-block.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "heading", + "content": [ + { + "type": "rule" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/heading-with-non-text-inline.json b/src/__tests__/integration/invalid/heading-with-non-text-inline.json new file mode 100644 index 00000000..8ad83ce5 --- /dev/null +++ b/src/__tests__/integration/invalid/heading-with-non-text-inline.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "heading", + "content": [ + { + "type": "emoji", + "attrs": { + "id": "xxxx", + "text": ":smile:" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/heading-with-unknown-attrs.json b/src/__tests__/integration/invalid/heading-with-unknown-attrs.json new file mode 100644 index 00000000..45f8c1c4 --- /dev/null +++ b/src/__tests__/integration/invalid/heading-with-unknown-attrs.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "heading", + "content": [ + { + "type": "text", + "text": "Heading" + } + ], + "attrs": { + "level": 1, + "foo": "bar" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/heading-without-attrs.json b/src/__tests__/integration/invalid/heading-without-attrs.json new file mode 100644 index 00000000..85ea9f5f --- /dev/null +++ b/src/__tests__/integration/invalid/heading-without-attrs.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "heading", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/inlineExtension-with-content.json b/src/__tests__/integration/invalid/inlineExtension-with-content.json new file mode 100644 index 00000000..ec20d680 --- /dev/null +++ b/src/__tests__/integration/invalid/inlineExtension-with-content.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "inlineExtension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro", + "extensionKey": "status" + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json b/src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json new file mode 100644 index 00000000..e63cebc4 --- /dev/null +++ b/src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "inlineExtension", + "attrs": { + "extensionType": "com.atlassian.confluence.macro" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/inlineExtension-without-extensionType.json b/src/__tests__/integration/invalid/inlineExtension-without-extensionType.json new file mode 100644 index 00000000..9cd9ccbb --- /dev/null +++ b/src/__tests__/integration/invalid/inlineExtension-without-extensionType.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "inlineExtension", + "attrs": { + "extensionKey": "status" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/link-with-empty-attrs.json b/src/__tests__/integration/invalid/link-with-empty-attrs.json new file mode 100644 index 00000000..071ee056 --- /dev/null +++ b/src/__tests__/integration/invalid/link-with-empty-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "link", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/link-with-unknown-attr.json b/src/__tests__/integration/invalid/link-with-unknown-attr.json new file mode 100644 index 00000000..071ee056 --- /dev/null +++ b/src/__tests__/integration/invalid/link-with-unknown-attr.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "link", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/list-with-blockquote.json b/src/__tests__/integration/invalid/list-with-blockquote.json new file mode 100644 index 00000000..5fda2aca --- /dev/null +++ b/src/__tests__/integration/invalid/list-with-blockquote.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "orderedList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/list-with-codeBlock.json b/src/__tests__/integration/invalid/list-with-codeBlock.json new file mode 100644 index 00000000..66b0e57f --- /dev/null +++ b/src/__tests__/integration/invalid/list-with-codeBlock.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "orderedList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "codeBlock", + "content": [], + "attrs": { + "language": "javascript" + }, + "marks": [] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/listItem-with-attrs.json b/src/__tests__/integration/invalid/listItem-with-attrs.json new file mode 100644 index 00000000..8b5e61e7 --- /dev/null +++ b/src/__tests__/integration/invalid/listItem-with-attrs.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/listItem-with-empty-content.json b/src/__tests__/integration/invalid/listItem-with-empty-content.json new file mode 100644 index 00000000..6096b90d --- /dev/null +++ b/src/__tests__/integration/invalid/listItem-with-empty-content.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "listItem", + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/listItem-with-list-as-first-child.json b/src/__tests__/integration/invalid/listItem-with-list-as-first-child.json new file mode 100644 index 00000000..eb57bf36 --- /dev/null +++ b/src/__tests__/integration/invalid/listItem-with-list-as-first-child.json @@ -0,0 +1,35 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "orderedList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/listItem-with-marks.json b/src/__tests__/integration/invalid/listItem-with-marks.json new file mode 100644 index 00000000..f2e15e39 --- /dev/null +++ b/src/__tests__/integration/invalid/listItem-with-marks.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "bulletList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "marks": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-as-top-level-node.json b/src/__tests__/integration/invalid/media-as-top-level-node.json new file mode 100644 index 00000000..5d1f7d47 --- /dev/null +++ b/src/__tests__/integration/invalid/media-as-top-level-node.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "media", + "attrs": { + "id": "1234", + "type": "file" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/media-with-empty-attrs.json b/src/__tests__/integration/invalid/media-with-empty-attrs.json new file mode 100644 index 00000000..7cc46096 --- /dev/null +++ b/src/__tests__/integration/invalid/media-with-empty-attrs.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": {} + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json b/src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json new file mode 100644 index 00000000..15e798f9 --- /dev/null +++ b/src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "type": "file", + "id": "1234", + "collection": "SampleCollection", + "occurrenceKey": "" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-with-marks.json b/src/__tests__/integration/invalid/media-with-marks.json new file mode 100644 index 00000000..d53a6c71 --- /dev/null +++ b/src/__tests__/integration/invalid/media-with-marks.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "id": "1234", + "type": "file" + }, + "marks": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-with-unknown-attr.json b/src/__tests__/integration/invalid/media-with-unknown-attr.json new file mode 100644 index 00000000..6af19c3d --- /dev/null +++ b/src/__tests__/integration/invalid/media-with-unknown-attr.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "type": "file", + "id": "1234", + "foo": "bar" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-without-attrs.json b/src/__tests__/integration/invalid/media-without-attrs.json new file mode 100644 index 00000000..f0c9588e --- /dev/null +++ b/src/__tests__/integration/invalid/media-without-attrs.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-without-id-attr.json b/src/__tests__/integration/invalid/media-without-id-attr.json new file mode 100644 index 00000000..93672192 --- /dev/null +++ b/src/__tests__/integration/invalid/media-without-id-attr.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "type": "file" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/media-without-type-attr.json b/src/__tests__/integration/invalid/media-without-type-attr.json new file mode 100644 index 00000000..e3ad8562 --- /dev/null +++ b/src/__tests__/integration/invalid/media-without-type-attr.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "id": "1234" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaGroup-with-attrs.json b/src/__tests__/integration/invalid/mediaGroup-with-attrs.json new file mode 100644 index 00000000..3d8df806 --- /dev/null +++ b/src/__tests__/integration/invalid/mediaGroup-with-attrs.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "type": "file", + "id": "1234" + } + } + ], + "attrs": {} + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaGroup-with-empty-content.json b/src/__tests__/integration/invalid/mediaGroup-with-empty-content.json new file mode 100644 index 00000000..8475363a --- /dev/null +++ b/src/__tests__/integration/invalid/mediaGroup-with-empty-content.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaGroup-with-marks.json b/src/__tests__/integration/invalid/mediaGroup-with-marks.json new file mode 100644 index 00000000..1219cdb9 --- /dev/null +++ b/src/__tests__/integration/invalid/mediaGroup-with-marks.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup", + "content": [ + { + "type": "media", + "attrs": { + "type": "file", + "id": "1234" + } + } + ], + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaGroup-without-content.json b/src/__tests__/integration/invalid/mediaGroup-without-content.json new file mode 100644 index 00000000..8a65c3cf --- /dev/null +++ b/src/__tests__/integration/invalid/mediaGroup-without-content.json @@ -0,0 +1,9 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaGroup" + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json b/src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json new file mode 100644 index 00000000..013b0a42 --- /dev/null +++ b/src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaSingle", + "attrs": {}, + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaSingle-with-empty-content.json b/src/__tests__/integration/invalid/mediaSingle-with-empty-content.json new file mode 100644 index 00000000..cd427da4 --- /dev/null +++ b/src/__tests__/integration/invalid/mediaSingle-with-empty-content.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaSingle", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json b/src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json new file mode 100644 index 00000000..6b290db1 --- /dev/null +++ b/src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json @@ -0,0 +1,38 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "mediaSingle", + "attrs": { + "layout": "center" + }, + "content": [ + { + "type": "media", + "attrs": { + "type": "file", + "id": "1234", + "collection": "SampleCollection" + } + } + ] + }, + { + "type": "mediaSingle", + "attrs": { + "layout": "" + }, + "content": [ + { + "type": "media", + "attrs": { + "type": "file", + "id": "1234", + "collection": "SampleCollection" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/mention-with-extra-attrs.json b/src/__tests__/integration/invalid/mention-with-extra-attrs.json new file mode 100644 index 00000000..5d4761c7 --- /dev/null +++ b/src/__tests__/integration/invalid/mention-with-extra-attrs.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "mention", + "attrs": { + "id": "test-id", + "text": "Test User", + "eyeColor": "brown" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/mention-with-invalid-user-type.json b/src/__tests__/integration/invalid/mention-with-invalid-user-type.json new file mode 100644 index 00000000..25964b17 --- /dev/null +++ b/src/__tests__/integration/invalid/mention-with-invalid-user-type.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "mention", + "attrs": { + "id": "test-rick", + "text": "@rick", + "userType": "SCIENTIST" + } + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/mention-with-marks.json b/src/__tests__/integration/invalid/mention-with-marks.json new file mode 100644 index 00000000..61f2049c --- /dev/null +++ b/src/__tests__/integration/invalid/mention-with-marks.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "mention", + "attrs": { + "id": "test-id", + "text": "Test User" + }, + "marks": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/mention-without-attrs.json b/src/__tests__/integration/invalid/mention-without-attrs.json new file mode 100644 index 00000000..e7e28177 --- /dev/null +++ b/src/__tests__/integration/invalid/mention-without-attrs.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "mention" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/mono-with-attrs.json b/src/__tests__/integration/invalid/mono-with-attrs.json new file mode 100644 index 00000000..cbf6f58c --- /dev/null +++ b/src/__tests__/integration/invalid/mono-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "mono", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/orderedList-with-extra-attrs.json b/src/__tests__/integration/invalid/orderedList-with-extra-attrs.json new file mode 100644 index 00000000..b452681b --- /dev/null +++ b/src/__tests__/integration/invalid/orderedList-with-extra-attrs.json @@ -0,0 +1,38 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "orderedList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + }, + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ], + "attrs": { + "order": 3, + "reverse": true + } + } + ] +} diff --git a/src/__tests__/integration/invalid/orderedList-with-marks.json b/src/__tests__/integration/invalid/orderedList-with-marks.json new file mode 100644 index 00000000..b5ac510f --- /dev/null +++ b/src/__tests__/integration/invalid/orderedList-with-marks.json @@ -0,0 +1,38 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "orderedList", + "content": [ + { + "type": "listItem", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + }, + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ], + "attrs": { + "order": 3 + }, + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/orderedList-without-content.json b/src/__tests__/integration/invalid/orderedList-without-content.json new file mode 100644 index 00000000..b72e8c5f --- /dev/null +++ b/src/__tests__/integration/invalid/orderedList-without-content.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "orderedList", + "content": [ + { + "type": "listItem", + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-with-blockquote.json b/src/__tests__/integration/invalid/panel-with-blockquote.json new file mode 100644 index 00000000..ac0bb9f4 --- /dev/null +++ b/src/__tests__/integration/invalid/panel-with-blockquote.json @@ -0,0 +1,29 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ], + "attrs": { + "panelType": "tip" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-with-codeBlock.json b/src/__tests__/integration/invalid/panel-with-codeBlock.json new file mode 100644 index 00000000..98f9e18b --- /dev/null +++ b/src/__tests__/integration/invalid/panel-with-codeBlock.json @@ -0,0 +1,22 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "codeBlock", + "content": [], + "attrs": { + "language": "javascript" + }, + "marks": [] + } + ], + "attrs": { + "panelType": "tip" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-with-empty-attrs.json b/src/__tests__/integration/invalid/panel-with-empty-attrs.json new file mode 100644 index 00000000..4b559252 --- /dev/null +++ b/src/__tests__/integration/invalid/panel-with-empty-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-with-marks.json b/src/__tests__/integration/invalid/panel-with-marks.json new file mode 100644 index 00000000..ed41db2f --- /dev/null +++ b/src/__tests__/integration/invalid/panel-with-marks.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": { + "panelType": "info" + }, + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-with-panel.json b/src/__tests__/integration/invalid/panel-with-panel.json new file mode 100644 index 00000000..89af1c5a --- /dev/null +++ b/src/__tests__/integration/invalid/panel-with-panel.json @@ -0,0 +1,29 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": {} + } + ], + "attrs": { + "panelType": "tip" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-with-unknown-attr.json b/src/__tests__/integration/invalid/panel-with-unknown-attr.json new file mode 100644 index 00000000..0b27f69b --- /dev/null +++ b/src/__tests__/integration/invalid/panel-with-unknown-attr.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ], + "attrs": { + "panelType": "info", + "foo": "bar" + } + } + ] +} diff --git a/src/__tests__/integration/invalid/panel-without-attrs.json b/src/__tests__/integration/invalid/panel-without-attrs.json new file mode 100644 index 00000000..99e0d5d6 --- /dev/null +++ b/src/__tests__/integration/invalid/panel-without-attrs.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "panel", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/paragraph-with-marks.json b/src/__tests__/integration/invalid/paragraph-with-marks.json new file mode 100644 index 00000000..5a004ddc --- /dev/null +++ b/src/__tests__/integration/invalid/paragraph-with-marks.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [], + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json b/src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json new file mode 100644 index 00000000..bae363e7 --- /dev/null +++ b/src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "foo", + "marks": [ + { + "type": "__unknown__" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/paragraph-with-top-level-content.json b/src/__tests__/integration/invalid/paragraph-with-top-level-content.json new file mode 100644 index 00000000..f3dce934 --- /dev/null +++ b/src/__tests__/integration/invalid/paragraph-with-top-level-content.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "rule" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/paragraph-without-content.json b/src/__tests__/integration/invalid/paragraph-without-content.json new file mode 100644 index 00000000..42953859 --- /dev/null +++ b/src/__tests__/integration/invalid/paragraph-without-content.json @@ -0,0 +1,9 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph" + } + ] +} diff --git a/src/__tests__/integration/invalid/placeholder-with-content.json b/src/__tests__/integration/invalid/placeholder-with-content.json new file mode 100644 index 00000000..e8e19950 --- /dev/null +++ b/src/__tests__/integration/invalid/placeholder-with-content.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "placeholder", + "attrs": { + "text": "Write something interesting..." + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/placeholder-with-empty-attrs.json b/src/__tests__/integration/invalid/placeholder-with-empty-attrs.json new file mode 100644 index 00000000..2e8f0ef2 --- /dev/null +++ b/src/__tests__/integration/invalid/placeholder-with-empty-attrs.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "placeholder", + "attrs": {} + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/rule-with-attrs.json b/src/__tests__/integration/invalid/rule-with-attrs.json new file mode 100644 index 00000000..cdc64c0c --- /dev/null +++ b/src/__tests__/integration/invalid/rule-with-attrs.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "rule", + "attrs": {} + } + ] +} diff --git a/src/__tests__/integration/invalid/rule-with-content.json b/src/__tests__/integration/invalid/rule-with-content.json new file mode 100644 index 00000000..84ac6d89 --- /dev/null +++ b/src/__tests__/integration/invalid/rule-with-content.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "rule", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/rule-with-marks.json b/src/__tests__/integration/invalid/rule-with-marks.json new file mode 100644 index 00000000..6733526e --- /dev/null +++ b/src/__tests__/integration/invalid/rule-with-marks.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "rule", + "marks": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/strike-with-attrs.json b/src/__tests__/integration/invalid/strike-with-attrs.json new file mode 100644 index 00000000..986993c7 --- /dev/null +++ b/src/__tests__/integration/invalid/strike-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "strike", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/strong-with-attrs.json b/src/__tests__/integration/invalid/strong-with-attrs.json new file mode 100644 index 00000000..a48ff302 --- /dev/null +++ b/src/__tests__/integration/invalid/strong-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "strong", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/subsup-with-extra-attrs.json b/src/__tests__/integration/invalid/subsup-with-extra-attrs.json new file mode 100644 index 00000000..5a1bf0be --- /dev/null +++ b/src/__tests__/integration/invalid/subsup-with-extra-attrs.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "subsup", + "attrs": { + "type": "sub", + "foo": "bar" + } + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json b/src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json new file mode 100644 index 00000000..109f46f0 --- /dev/null +++ b/src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "subsup", + "attrs": { + "type": "foo" + } + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/subsup-without-attrs.json b/src/__tests__/integration/invalid/subsup-without-attrs.json new file mode 100644 index 00000000..64672a45 --- /dev/null +++ b/src/__tests__/integration/invalid/subsup-without-attrs.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "subsup" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/subsup-without-type-attr.json b/src/__tests__/integration/invalid/subsup-without-type-attr.json new file mode 100644 index 00000000..5d61a4aa --- /dev/null +++ b/src/__tests__/integration/invalid/subsup-without-type-attr.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "subsup", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/table-with-nested-table.json b/src/__tests__/integration/invalid/table-with-nested-table.json new file mode 100644 index 00000000..60da684f --- /dev/null +++ b/src/__tests__/integration/invalid/table-with-nested-table.json @@ -0,0 +1,50 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "table", + "content": [ + { + "type": "tableRow", + "content": [ + { + "type": "tableHeader", + "attrs": { + "colspan": 1, + "rowspan": 1, + "background": null + }, + "content": [ + { + "type": "table", + "content": [ + { + "type": "tableRow", + "content": [ + { + "type": "tableCell", + "attrs": { + "colspan": 1, + "rowspan": 1, + "background": null + }, + "content": [ + { + "type": "paragraph", + "content": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/table-without-cells.json b/src/__tests__/integration/invalid/table-without-cells.json new file mode 100644 index 00000000..6887cd7d --- /dev/null +++ b/src/__tests__/integration/invalid/table-without-cells.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "table", + "content": [ + { + "type": "tableRow", + "content": null + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/table-without-rows.json b/src/__tests__/integration/invalid/table-without-rows.json new file mode 100644 index 00000000..5c185ed5 --- /dev/null +++ b/src/__tests__/integration/invalid/table-without-rows.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "table", + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/task-with-blockquote.json b/src/__tests__/integration/invalid/task-with-blockquote.json new file mode 100644 index 00000000..3dddd266 --- /dev/null +++ b/src/__tests__/integration/invalid/task-with-blockquote.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "taskList", + "attrs": { + "localId": "test-list-id" + }, + "content": [ + { + "type": "taskItem", + "attrs": { + "localId": "test-id", + "state": "TODO" + }, + "content": [ + { + "type": "blockquote", + "content": [ + { + "type": "rule" + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/task-with-invalid-state.json b/src/__tests__/integration/invalid/task-with-invalid-state.json new file mode 100644 index 00000000..608a93ed --- /dev/null +++ b/src/__tests__/integration/invalid/task-with-invalid-state.json @@ -0,0 +1,27 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "taskList", + "attrs": { + "localId": "test-list-id" + }, + "content": [ + { + "type": "taskItem", + "attrs": { + "localId": "test-id", + "state": "NOPE" + }, + "content": [ + { + "type": "text", + "text": "Nope" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/taskList-with-empty-task.json b/src/__tests__/integration/invalid/taskList-with-empty-task.json new file mode 100644 index 00000000..07b82a03 --- /dev/null +++ b/src/__tests__/integration/invalid/taskList-with-empty-task.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "taskList", + "attrs": { + "order": 1, + "localId": "test-list-id" + }, + "content": [ + { + "type": "taskItem", + "attrs": { + "localId": "test-id", + "state": "TODO" + }, + "content": [] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/taskList-with-no-task.json b/src/__tests__/integration/invalid/taskList-with-no-task.json new file mode 100644 index 00000000..63b4f504 --- /dev/null +++ b/src/__tests__/integration/invalid/taskList-with-no-task.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "taskList", + "attrs": { + "order": 1 + }, + "content": [] + } + ] +} diff --git a/src/__tests__/integration/invalid/text-empty.json b/src/__tests__/integration/invalid/text-empty.json new file mode 100644 index 00000000..3a9b77bd --- /dev/null +++ b/src/__tests__/integration/invalid/text-empty.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "" + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/textColor-with-extra-attrs.json b/src/__tests__/integration/invalid/textColor-with-extra-attrs.json new file mode 100644 index 00000000..35fb8a63 --- /dev/null +++ b/src/__tests__/integration/invalid/textColor-with-extra-attrs.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "textColor", + "attrs": { + "color": "#97a0af", + "foo": "bar" + } + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json b/src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json new file mode 100644 index 00000000..1aaa9c31 --- /dev/null +++ b/src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "textColor", + "attrs": { + "color": "#fffffF" + } + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/textColor-without-attrs.json b/src/__tests__/integration/invalid/textColor-without-attrs.json new file mode 100644 index 00000000..1e49f3e7 --- /dev/null +++ b/src/__tests__/integration/invalid/textColor-without-attrs.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "textColor" + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/textColor-without-color-attr.json b/src/__tests__/integration/invalid/textColor-without-color-attr.json new file mode 100644 index 00000000..7be9f4bf --- /dev/null +++ b/src/__tests__/integration/invalid/textColor-without-color-attr.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "textColor", + "attrs": {} + } + ] + } + ] + } + ] +} diff --git a/src/__tests__/integration/invalid/underline-with-attrs.json b/src/__tests__/integration/invalid/underline-with-attrs.json new file mode 100644 index 00000000..c9c956b7 --- /dev/null +++ b/src/__tests__/integration/invalid/underline-with-attrs.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Foo", + "marks": [ + { + "type": "underline", + "attrs": {} + } + ] + } + ] + } + ] +} From e3ac53e5f8ceb410df8f8b0068cff5ff736133ca Mon Sep 17 00:00:00 2001 From: Tong Li Date: Mon, 17 Sep 2018 14:18:37 +1000 Subject: [PATCH 4/4] remove integration test --- package.json | 1 - .../integration/__snapshots__/index.js.snap | 5623 ----------------- src/__tests__/integration/adfSchema.json | 1582 ----- src/__tests__/integration/index.js | 35 - ...cationCard-with-additional-properties.json | 83 - .../applicationCard-with-wrong-details.json | 82 - .../applicationCard-with-wrong-link.json | 80 - .../applicationCard-with-wrong-title.json | 81 - .../applicationCard-without-attrs-text.json | 82 - .../applicationCard-without-link-url.json | 80 - .../invalid/blockQuote-with-attrs.json | 21 - .../blockQuote-with-empty-content.json | 10 - .../invalid/blockQuote-with-marks.json | 21 - .../invalid/blockQuote-without-content.json | 9 - .../invalid/blockquote-with-list-inside.json | 30 - ...extension-with-nested-bodiedExtension.json | 28 - .../bodied-extension-without-content.json | 13 - ...bodied-extension-without-extensionKey.json | 18 - ...odied-extension-without-extensionType.json | 18 - .../invalid/bulletList-with-attrs.json | 21 - .../bulletList-with-empty-content.json | 10 - .../invalid/bulletList-with-marks.json | 26 - .../bulletList-with-not-listItem-content.json | 20 - .../invalid/bulletList-without-content.json | 9 - .../integration/invalid/code-and-em.json | 23 - .../integration/invalid/code-and-strike.json | 23 - .../integration/invalid/code-and-strong.json | 23 - .../integration/invalid/code-and-subsup.json | 23 - .../invalid/code-and-underline.json | 23 - .../integration/invalid/code-with-attrs.json | 21 - .../invalid/codeBlock-with-marks.json | 14 - .../invalid/codeBlock-with-non-text.json | 14 - .../invalid/codeBlock-with-strong.json | 20 - .../invalid/codeBlock-with-unknown-attrs.json | 13 - .../codeBlock-with-unknown-language.json | 13 - .../invalid/decision-with-blockquote.json | 31 - .../decisionList-with-empty-decision.json | 23 - .../decisionList-with-no-decision.json | 13 - .../integration/invalid/doc-with-attrs.json | 10 - .../invalid/doc-with-empty-content.json | 5 - .../integration/invalid/doc-with-marks.json | 10 - .../invalid/doc-without-content.json | 4 - .../invalid/doc-without-version.json | 4 - .../integration/invalid/em-with-attrs.json | 21 - .../invalid/emoji-as-top-level-node.json | 12 - .../invalid/emoji-with-content.json | 23 - .../invalid/emoji-with-empty-attrs.json | 15 - .../integration/invalid/emoji-with-marks.json | 18 - .../invalid/emoji-with-unknown-attr.json | 18 - .../invalid/emoji-without-attrs.json | 14 - .../invalid/extension-with-content.json | 19 - .../extension-without-extensionKey.json | 12 - .../extension-without-extensionType.json | 12 - .../invalid/hardBreak-with-marks.json | 18 - .../invalid/hardBreak-with-wrong-text.json | 17 - .../heading-with-invalid-level-attr.json | 18 - .../invalid/heading-with-marks.json | 14 - .../invalid/heading-with-non-text-block.json | 14 - .../invalid/heading-with-non-text-inline.json | 18 - .../invalid/heading-with-unknown-attrs.json | 19 - .../invalid/heading-without-attrs.json | 10 - .../invalid/inlineExtension-with-content.json | 24 - .../inlineExtension-without-extensionKey.json | 17 - ...inlineExtension-without-extensionType.json | 17 - .../invalid/link-with-empty-attrs.json | 21 - .../invalid/link-with-unknown-attr.json | 21 - .../invalid/link-without-attrs.json | 20 - .../invalid/list-with-blockquote.json | 31 - .../invalid/list-with-codeBlock.json | 24 - .../invalid/listItem-with-attrs.json | 26 - .../invalid/listItem-with-empty-content.json | 15 - .../listItem-with-list-as-first-child.json | 35 - .../invalid/listItem-with-marks.json | 26 - .../invalid/media-as-top-level-node.json | 13 - .../invalid/media-with-empty-attrs.json | 15 - ...edia-with-invalid-occurrence-key-attr.json | 20 - .../integration/invalid/media-with-marks.json | 19 - .../invalid/media-with-unknown-attr.json | 19 - .../invalid/media-without-attrs.json | 14 - .../invalid/media-without-id-attr.json | 17 - .../invalid/media-without-type-attr.json | 17 - .../invalid/mediaGroup-with-attrs.json | 19 - .../mediaGroup-with-empty-content.json | 10 - .../invalid/mediaGroup-with-marks.json | 19 - .../invalid/mediaGroup-without-content.json | 9 - .../invalid/mediaSingle-with-empty-attrs.json | 11 - .../mediaSingle-with-empty-content.json | 10 - .../mediaSingle-with-invalid-layout-attr.json | 38 - .../invalid/mention-with-extra-attrs.json | 19 - .../mention-with-invalid-user-type.json | 19 - .../invalid/mention-with-marks.json | 19 - .../invalid/mention-without-attrs.json | 14 - .../integration/invalid/mono-with-attrs.json | 21 - .../invalid/orderedList-with-extra-attrs.json | 38 - .../invalid/orderedList-with-marks.json | 38 - .../invalid/orderedList-without-content.json | 15 - .../invalid/panel-with-blockquote.json | 29 - .../invalid/panel-with-codeBlock.json | 22 - .../invalid/panel-with-empty-attrs.json | 21 - .../integration/invalid/panel-with-marks.json | 24 - .../integration/invalid/panel-with-panel.json | 29 - .../invalid/panel-with-unknown-attr.json | 24 - .../invalid/panel-without-attrs.json | 20 - .../invalid/paragraph-with-marks.json | 11 - ...paragraph-with-text-with-unknown-mark.json | 20 - .../paragraph-with-top-level-content.json | 14 - .../invalid/paragraph-without-content.json | 9 - .../invalid/placeholder-with-content.json | 23 - .../invalid/placeholder-with-empty-attrs.json | 15 - .../integration/invalid/rule-with-attrs.json | 10 - .../invalid/rule-with-content.json | 10 - .../integration/invalid/rule-with-marks.json | 10 - .../invalid/strike-with-attrs.json | 21 - .../invalid/strong-with-attrs.json | 21 - .../invalid/subsup-with-extra-attrs.json | 24 - .../subsup-with-invalid-type-attr.json | 23 - .../invalid/subsup-without-attrs.json | 20 - .../invalid/subsup-without-type-attr.json | 21 - .../invalid/table-with-nested-table.json | 50 - .../invalid/table-without-cells.json | 15 - .../invalid/table-without-rows.json | 10 - .../invalid/task-with-blockquote.json | 31 - .../invalid/task-with-invalid-state.json | 27 - .../invalid/taskList-with-empty-task.json | 23 - .../invalid/taskList-with-no-task.json | 13 - .../integration/invalid/text-empty.json | 15 - .../invalid/textColor-with-extra-attrs.json | 24 - .../textColor-with-invalid-color-attr.json | 23 - .../invalid/textColor-without-attrs.json | 20 - .../invalid/textColor-without-color-attr.json | 21 - .../invalid/underline-with-attrs.json | 21 - src/json/get-decorated-data-pah.js | 2 +- src/json/get-meta-from-path.js | 13 - 133 files changed, 1 insertion(+), 10023 deletions(-) delete mode 100644 src/__tests__/integration/__snapshots__/index.js.snap delete mode 100644 src/__tests__/integration/adfSchema.json delete mode 100644 src/__tests__/integration/index.js delete mode 100644 src/__tests__/integration/invalid/applicationCard-with-additional-properties.json delete mode 100644 src/__tests__/integration/invalid/applicationCard-with-wrong-details.json delete mode 100644 src/__tests__/integration/invalid/applicationCard-with-wrong-link.json delete mode 100644 src/__tests__/integration/invalid/applicationCard-with-wrong-title.json delete mode 100644 src/__tests__/integration/invalid/applicationCard-without-attrs-text.json delete mode 100644 src/__tests__/integration/invalid/applicationCard-without-link-url.json delete mode 100644 src/__tests__/integration/invalid/blockQuote-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/blockQuote-with-empty-content.json delete mode 100644 src/__tests__/integration/invalid/blockQuote-with-marks.json delete mode 100644 src/__tests__/integration/invalid/blockQuote-without-content.json delete mode 100644 src/__tests__/integration/invalid/blockquote-with-list-inside.json delete mode 100644 src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json delete mode 100644 src/__tests__/integration/invalid/bodied-extension-without-content.json delete mode 100644 src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json delete mode 100644 src/__tests__/integration/invalid/bodied-extension-without-extensionType.json delete mode 100644 src/__tests__/integration/invalid/bulletList-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/bulletList-with-empty-content.json delete mode 100644 src/__tests__/integration/invalid/bulletList-with-marks.json delete mode 100644 src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json delete mode 100644 src/__tests__/integration/invalid/bulletList-without-content.json delete mode 100644 src/__tests__/integration/invalid/code-and-em.json delete mode 100644 src/__tests__/integration/invalid/code-and-strike.json delete mode 100644 src/__tests__/integration/invalid/code-and-strong.json delete mode 100644 src/__tests__/integration/invalid/code-and-subsup.json delete mode 100644 src/__tests__/integration/invalid/code-and-underline.json delete mode 100644 src/__tests__/integration/invalid/code-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/codeBlock-with-marks.json delete mode 100644 src/__tests__/integration/invalid/codeBlock-with-non-text.json delete mode 100644 src/__tests__/integration/invalid/codeBlock-with-strong.json delete mode 100644 src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json delete mode 100644 src/__tests__/integration/invalid/codeBlock-with-unknown-language.json delete mode 100644 src/__tests__/integration/invalid/decision-with-blockquote.json delete mode 100644 src/__tests__/integration/invalid/decisionList-with-empty-decision.json delete mode 100644 src/__tests__/integration/invalid/decisionList-with-no-decision.json delete mode 100644 src/__tests__/integration/invalid/doc-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/doc-with-empty-content.json delete mode 100644 src/__tests__/integration/invalid/doc-with-marks.json delete mode 100644 src/__tests__/integration/invalid/doc-without-content.json delete mode 100644 src/__tests__/integration/invalid/doc-without-version.json delete mode 100644 src/__tests__/integration/invalid/em-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/emoji-as-top-level-node.json delete mode 100644 src/__tests__/integration/invalid/emoji-with-content.json delete mode 100644 src/__tests__/integration/invalid/emoji-with-empty-attrs.json delete mode 100644 src/__tests__/integration/invalid/emoji-with-marks.json delete mode 100644 src/__tests__/integration/invalid/emoji-with-unknown-attr.json delete mode 100644 src/__tests__/integration/invalid/emoji-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/extension-with-content.json delete mode 100644 src/__tests__/integration/invalid/extension-without-extensionKey.json delete mode 100644 src/__tests__/integration/invalid/extension-without-extensionType.json delete mode 100644 src/__tests__/integration/invalid/hardBreak-with-marks.json delete mode 100644 src/__tests__/integration/invalid/hardBreak-with-wrong-text.json delete mode 100644 src/__tests__/integration/invalid/heading-with-invalid-level-attr.json delete mode 100644 src/__tests__/integration/invalid/heading-with-marks.json delete mode 100644 src/__tests__/integration/invalid/heading-with-non-text-block.json delete mode 100644 src/__tests__/integration/invalid/heading-with-non-text-inline.json delete mode 100644 src/__tests__/integration/invalid/heading-with-unknown-attrs.json delete mode 100644 src/__tests__/integration/invalid/heading-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/inlineExtension-with-content.json delete mode 100644 src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json delete mode 100644 src/__tests__/integration/invalid/inlineExtension-without-extensionType.json delete mode 100644 src/__tests__/integration/invalid/link-with-empty-attrs.json delete mode 100644 src/__tests__/integration/invalid/link-with-unknown-attr.json delete mode 100644 src/__tests__/integration/invalid/link-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/list-with-blockquote.json delete mode 100644 src/__tests__/integration/invalid/list-with-codeBlock.json delete mode 100644 src/__tests__/integration/invalid/listItem-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/listItem-with-empty-content.json delete mode 100644 src/__tests__/integration/invalid/listItem-with-list-as-first-child.json delete mode 100644 src/__tests__/integration/invalid/listItem-with-marks.json delete mode 100644 src/__tests__/integration/invalid/media-as-top-level-node.json delete mode 100644 src/__tests__/integration/invalid/media-with-empty-attrs.json delete mode 100644 src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json delete mode 100644 src/__tests__/integration/invalid/media-with-marks.json delete mode 100644 src/__tests__/integration/invalid/media-with-unknown-attr.json delete mode 100644 src/__tests__/integration/invalid/media-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/media-without-id-attr.json delete mode 100644 src/__tests__/integration/invalid/media-without-type-attr.json delete mode 100644 src/__tests__/integration/invalid/mediaGroup-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/mediaGroup-with-empty-content.json delete mode 100644 src/__tests__/integration/invalid/mediaGroup-with-marks.json delete mode 100644 src/__tests__/integration/invalid/mediaGroup-without-content.json delete mode 100644 src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json delete mode 100644 src/__tests__/integration/invalid/mediaSingle-with-empty-content.json delete mode 100644 src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json delete mode 100644 src/__tests__/integration/invalid/mention-with-extra-attrs.json delete mode 100644 src/__tests__/integration/invalid/mention-with-invalid-user-type.json delete mode 100644 src/__tests__/integration/invalid/mention-with-marks.json delete mode 100644 src/__tests__/integration/invalid/mention-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/mono-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/orderedList-with-extra-attrs.json delete mode 100644 src/__tests__/integration/invalid/orderedList-with-marks.json delete mode 100644 src/__tests__/integration/invalid/orderedList-without-content.json delete mode 100644 src/__tests__/integration/invalid/panel-with-blockquote.json delete mode 100644 src/__tests__/integration/invalid/panel-with-codeBlock.json delete mode 100644 src/__tests__/integration/invalid/panel-with-empty-attrs.json delete mode 100644 src/__tests__/integration/invalid/panel-with-marks.json delete mode 100644 src/__tests__/integration/invalid/panel-with-panel.json delete mode 100644 src/__tests__/integration/invalid/panel-with-unknown-attr.json delete mode 100644 src/__tests__/integration/invalid/panel-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/paragraph-with-marks.json delete mode 100644 src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json delete mode 100644 src/__tests__/integration/invalid/paragraph-with-top-level-content.json delete mode 100644 src/__tests__/integration/invalid/paragraph-without-content.json delete mode 100644 src/__tests__/integration/invalid/placeholder-with-content.json delete mode 100644 src/__tests__/integration/invalid/placeholder-with-empty-attrs.json delete mode 100644 src/__tests__/integration/invalid/rule-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/rule-with-content.json delete mode 100644 src/__tests__/integration/invalid/rule-with-marks.json delete mode 100644 src/__tests__/integration/invalid/strike-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/strong-with-attrs.json delete mode 100644 src/__tests__/integration/invalid/subsup-with-extra-attrs.json delete mode 100644 src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json delete mode 100644 src/__tests__/integration/invalid/subsup-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/subsup-without-type-attr.json delete mode 100644 src/__tests__/integration/invalid/table-with-nested-table.json delete mode 100644 src/__tests__/integration/invalid/table-without-cells.json delete mode 100644 src/__tests__/integration/invalid/table-without-rows.json delete mode 100644 src/__tests__/integration/invalid/task-with-blockquote.json delete mode 100644 src/__tests__/integration/invalid/task-with-invalid-state.json delete mode 100644 src/__tests__/integration/invalid/taskList-with-empty-task.json delete mode 100644 src/__tests__/integration/invalid/taskList-with-no-task.json delete mode 100644 src/__tests__/integration/invalid/text-empty.json delete mode 100644 src/__tests__/integration/invalid/textColor-with-extra-attrs.json delete mode 100644 src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json delete mode 100644 src/__tests__/integration/invalid/textColor-without-attrs.json delete mode 100644 src/__tests__/integration/invalid/textColor-without-color-attr.json delete mode 100644 src/__tests__/integration/invalid/underline-with-attrs.json diff --git a/package.json b/package.json index 69c7a0d4..2f8e84d0 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@babel/plugin-transform-runtime": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-flow": "7.0.0", - "ajv": "^6.5.3", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^23.6.0", "babel-plugin-add-module-exports": "^1.0.0", diff --git a/src/__tests__/integration/__snapshots__/index.js.snap b/src/__tests__/integration/__snapshots__/index.js.snap deleted file mode 100644 index d61f9a7a..00000000 --- a/src/__tests__/integration/__snapshots__/index.js.snap +++ /dev/null @@ -1,5623 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Integration Test - shows better error for 'applicationCard-with-additional-properties.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 93, - "line": 1, - "offset": 92, - }, - "error": "/content/0:applicationCard/attrs Property text2 is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 86, - "line": 1, - "offset": 85, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'applicationCard-with-wrong-details.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 548, - "line": 1, - "offset": 547, - }, - "error": "/content/0:applicationCard/attrs/details/0/badge/theme should be equal to one of the allowed values: default, dark", - "path": "/content/0/attrs/details/0/badge/theme", - "start": Object { - "column": 541, - "line": 1, - "offset": 540, - }, - "suggestion": "Did you mean dark?", - }, -] -`; - -exports[`Integration Test - shows better error for 'applicationCard-with-wrong-link.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 158, - "line": 1, - "offset": 157, - }, - "error": "/content/0:applicationCard/attrs/link: type should be object", - "path": "/content/0/attrs/link", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'applicationCard-with-wrong-title.json 1`] = ` -Array [ - Object { - "error": "/content/0:applicationCard/attrs/title should have required property 'text'", - "path": "/content/0/attrs/title", - "start": Object { - "column": 289, - "line": 1, - "offset": 288, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'applicationCard-without-attrs-text.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - "error": "/content/0:applicationCard Property text is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, - Object { - "end": Object { - "column": 872, - "line": 1, - "offset": 871, - }, - "error": "/content/0:applicationCard: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'applicationCard-without-link-url.json 1`] = ` -Array [ - Object { - "error": "/content/0:applicationCard/attrs/link should have required property 'url'", - "path": "/content/0/attrs/link", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'blockQuote-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - "error": "/content/0:blockquote/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'blockQuote-with-empty-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - "error": "/content/0:blockquote/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'blockQuote-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:blockquote Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:blockquote Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:blockquote Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:blockquote Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - }, - Object { - "end": Object { - "column": 144, - "line": 1, - "offset": 143, - }, - "error": "/content/0:blockquote: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'blockQuote-without-content.json 1`] = ` -Array [ - Object { - "error": "/content/0:blockquote should have required property 'content'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'blockquote-with-list-inside.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 90, - "line": 1, - "offset": 89, - }, - "error": "/content/0:blockquote/content/0:bulletList/type should be equal to one of the allowed values: paragraph", - "path": "/content/0/content/0/type", - "start": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "suggestion": "Did you mean paragraph?", - }, -] -`; - -exports[`Integration Test - shows better error for 'bodied-extension-with-nested-bodiedExtension.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 188, - "line": 1, - "offset": 187, - }, - "error": "/content/0:bodiedExtension/content/0:bodiedExtension/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, codeBlock", - "path": "/content/0/content/0/type", - "start": Object { - "column": 171, - "line": 1, - "offset": 170, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'bodied-extension-without-content.json 1`] = ` -Array [ - Object { - "error": "/content/0:bodiedExtension should have required property 'content'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'bodied-extension-without-extensionKey.json 1`] = ` -Array [ - Object { - "error": "/content/0:bodiedExtension/attrs should have required property 'extensionKey'", - "path": "/content/0/attrs", - "start": Object { - "column": 72, - "line": 1, - "offset": 71, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'bodied-extension-without-extensionType.json 1`] = ` -Array [ - Object { - "error": "/content/0:bodiedExtension/attrs should have required property 'extensionType'", - "path": "/content/0/attrs", - "start": Object { - "column": 72, - "line": 1, - "offset": 71, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'bulletList-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - "error": "/content/0:bulletList/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - "suggestion": "Did you mean orderedList?", - }, -] -`; - -exports[`Integration Test - shows better error for 'bulletList-with-empty-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - "error": "/content/0:bulletList/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'bulletList-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:bulletList Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:bulletList Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:bulletList Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 172, - "line": 1, - "offset": 171, - }, - "error": "/content/0:bulletList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - }, - Object { - "end": Object { - "column": 176, - "line": 1, - "offset": 175, - }, - "error": "/content/0:bulletList: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'bulletList-with-not-listItem-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - "error": "/content/0:bulletList/content/0:paragraph/type should be equal to one of the allowed values: listItem", - "path": "/content/0/content/0/type", - "start": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "suggestion": "Did you mean listItem?", - }, -] -`; - -exports[`Integration Test - shows better error for 'bulletList-without-content.json 1`] = ` -Array [ - Object { - "error": "/content/0:bulletList should have required property 'content'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'code-and-em.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, - Object { - "end": Object { - "column": 134, - "line": 1, - "offset": 133, - }, - "error": "/content/0:paragraph/content/0:text/marks/1:em/type should be equal to one of the allowed values: code, link", - "path": "/content/0/content/0/marks/1/type", - "start": Object { - "column": 130, - "line": 1, - "offset": 129, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'code-and-strike.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:text/marks/1:strike/type should be equal to one of the allowed values: code, link", - "path": "/content/0/content/0/marks/1/type", - "start": Object { - "column": 130, - "line": 1, - "offset": 129, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'code-and-strong.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:text/marks/1:strong/type should be equal to one of the allowed values: code, link", - "path": "/content/0/content/0/marks/1/type", - "start": Object { - "column": 130, - "line": 1, - "offset": 129, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'code-and-subsup.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:text/marks/1:subsup/type should be equal to one of the allowed values: code, link", - "path": "/content/0/content/0/marks/1/type", - "start": Object { - "column": 130, - "line": 1, - "offset": 129, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'code-and-underline.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, - Object { - "end": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - "error": "/content/0:paragraph/content/0:text/marks/1:underline/type should be equal to one of the allowed values: code, link", - "path": "/content/0/content/0/marks/1/type", - "start": Object { - "column": 130, - "line": 1, - "offset": 129, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'code-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:code/type should be equal to one of the allowed values: link, subsup, textColor, action, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'codeBlock-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 67, - "line": 1, - "offset": 66, - }, - "error": "/content/0:codeBlock Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 67, - "line": 1, - "offset": 66, - }, - "error": "/content/0:codeBlock Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 67, - "line": 1, - "offset": 66, - }, - "error": "/content/0:codeBlock Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 112, - "line": 1, - "offset": 111, - }, - "error": "/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, - Object { - "end": Object { - "column": 116, - "line": 1, - "offset": 115, - }, - "error": "/content/0:codeBlock: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'codeBlock-with-non-text.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 83, - "line": 1, - "offset": 82, - }, - "error": "/content/0:codeBlock/content/0:rule/type should be equal to one of the allowed values: text", - "path": "/content/0/content/0/type", - "start": Object { - "column": 77, - "line": 1, - "offset": 76, - }, - "suggestion": "Did you mean text?", - }, -] -`; - -exports[`Integration Test - shows better error for 'codeBlock-with-strong.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - "error": "/content/0:codeBlock/content/0:text/marks: maxItems should NOT have more than 0 items", - "path": "/content/0/content/0/marks", - "start": Object { - "column": 92, - "line": 1, - "offset": 91, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'codeBlock-with-unknown-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:codeBlock/attrs/language should be equal to one of the allowed values: abap, actionscript, ada, arduino, autoit, c, c++, clojure, coffeescript, csharp, css, cuda, d, dart, delphi, elixir, erlang, fortran, foxpro, go, groovy, haskell, haxe, html, java, javascript, json, julia, kotlin, latex, livescript, lua, mathematica, matlab, objective-c, objective-j, objectpascal, ocaml, octave, perl, php, powershell, prolog, puppet, python, qml, r, racket, restructuredtext, ruby, rust, sass, scala, scheme, shell, smalltalk, sql, standardml, swift, tcl, tex, typescript, vala, vbnet, verilog, vhdl, xml, xquery", - "path": "/content/0/attrs/language", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'codeBlock-with-unknown-language.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 85, - "line": 1, - "offset": 84, - }, - "error": "/content/0:codeBlock/attrs Property foo is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 80, - "line": 1, - "offset": 79, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'decision-with-blockquote.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 219, - "line": 1, - "offset": 218, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 210, - "line": 1, - "offset": 209, - }, - }, - Object { - "end": Object { - "column": 238, - "line": 1, - "offset": 237, - }, - "error": "/content/0:decisionList/content/0:decisionItem/content/0:blockquote: anyOf should match some schema in anyOf", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 189, - "line": 1, - "offset": 188, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'decisionList-with-empty-decision.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 77, - "line": 1, - "offset": 76, - }, - "error": "/content/0:decisionList/attrs Property order is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'decisionList-with-no-decision.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 93, - "line": 1, - "offset": 92, - }, - "error": "/content/0:decisionList/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'doc-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 62, - "line": 1, - "offset": 61, - }, - "error": " Property attrs is not expected to be here", - "path": "", - "start": Object { - "column": 55, - "line": 1, - "offset": 54, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'doc-with-empty-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 39, - "line": 1, - "offset": 38, - }, - "error": "/content: minItems should NOT have less than 1 items", - "path": "/content", - "start": Object { - "column": 37, - "line": 1, - "offset": 36, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'doc-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 62, - "line": 1, - "offset": 61, - }, - "error": " Property marks is not expected to be here", - "path": "", - "start": Object { - "column": 55, - "line": 1, - "offset": 54, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'doc-without-content.json 1`] = ` -Array [ - Object { - "error": " should have required property 'content'", - "path": "", - "start": Object { - "column": 1, - "line": 1, - "offset": 0, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'doc-without-version.json 1`] = ` -Array [ - Object { - "error": " should have required property 'version'", - "path": "", - "start": Object { - "column": 1, - "line": 1, - "offset": 0, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'em-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:em/type should be equal to one of the allowed values: link, subsup, textColor, action, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'emoji-as-top-level-node.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - "error": "/content/0:emoji/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, applicationCard, decisionList, taskList, extension, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'emoji-with-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 115, - "line": 1, - "offset": 114, - }, - "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 115, - "line": 1, - "offset": 114, - }, - "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 115, - "line": 1, - "offset": 114, - }, - "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 115, - "line": 1, - "offset": 114, - }, - "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 115, - "line": 1, - "offset": 114, - }, - "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 115, - "line": 1, - "offset": 114, - }, - "error": "/content/0:paragraph/content/0:emoji Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 92, - "line": 1, - "offset": 91, - }, - "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 85, - "line": 1, - "offset": 84, - }, - }, - Object { - "end": Object { - "column": 92, - "line": 1, - "offset": 91, - }, - "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 85, - "line": 1, - "offset": 84, - }, - }, - Object { - "end": Object { - "column": 144, - "line": 1, - "offset": 143, - }, - "error": "/content/0:paragraph/content/0:emoji: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'emoji-with-empty-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:emoji/attrs should have required property 'shortName'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 93, - "line": 1, - "offset": 92, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'emoji-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:paragraph/content/0:emoji Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, - Object { - "end": Object { - "column": 92, - "line": 1, - "offset": 91, - }, - "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 85, - "line": 1, - "offset": 84, - }, - }, - Object { - "end": Object { - "column": 92, - "line": 1, - "offset": 91, - }, - "error": "/content/0:paragraph/content/0:emoji Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 85, - "line": 1, - "offset": 84, - }, - }, - Object { - "end": Object { - "column": 117, - "line": 1, - "offset": 116, - }, - "error": "/content/0:paragraph/content/0:emoji: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'emoji-with-unknown-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 110, - "line": 1, - "offset": 109, - }, - "error": "/content/0:paragraph/content/0:emoji/attrs Property foo is not expected to be here", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'emoji-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:emoji should have required property 'attrs'", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'extension-with-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 57, - "line": 1, - "offset": 56, - }, - "error": "/content/0:extension/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - "suggestion": "Did you mean bodiedExtension?", - }, -] -`; - -exports[`Integration Test - shows better error for 'extension-without-extensionKey.json 1`] = ` -Array [ - Object { - "error": "/content/0:extension/attrs should have required property 'extensionKey'", - "path": "/content/0/attrs", - "start": Object { - "column": 66, - "line": 1, - "offset": 65, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'extension-without-extensionType.json 1`] = ` -Array [ - Object { - "error": "/content/0:extension/attrs should have required property 'extensionType'", - "path": "/content/0/attrs", - "start": Object { - "column": 66, - "line": 1, - "offset": 65, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'hardBreak-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - }, - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - }, - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - }, - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - }, - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - }, - Object { - "end": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 111, - "line": 1, - "offset": 110, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:paragraph/content/0:hardBreak Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 122, - "line": 1, - "offset": 121, - }, - "error": "/content/0:paragraph/content/0:hardBreak: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'hardBreak-with-wrong-text.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 88, - "line": 1, - "offset": 87, - }, - "error": "/content/0:paragraph/content/0:hardBreak/type should be equal to one of the allowed values: emoji, mention, inlineExtension, date, placeholder", - "path": "/content/0/content/0/type", - "start": Object { - "column": 77, - "line": 1, - "offset": 76, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'heading-with-invalid-level-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 119, - "line": 1, - "offset": 118, - }, - "error": "/content/0:heading/attrs/level: maximum should be <= 6", - "path": "/content/0/attrs/level", - "start": Object { - "column": 118, - "line": 1, - "offset": 117, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'heading-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 76, - "line": 1, - "offset": 75, - }, - "error": "/content/0:heading Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, - Object { - "end": Object { - "column": 76, - "line": 1, - "offset": 75, - }, - "error": "/content/0:heading Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 76, - "line": 1, - "offset": 75, - }, - "error": "/content/0:heading Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, - Object { - "end": Object { - "column": 65, - "line": 1, - "offset": 64, - }, - "error": "/content/0:heading Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 56, - "line": 1, - "offset": 55, - }, - }, - Object { - "end": Object { - "column": 76, - "line": 1, - "offset": 75, - }, - "error": "/content/0:heading Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 65, - "line": 1, - "offset": 64, - }, - "error": "/content/0:heading Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 56, - "line": 1, - "offset": 55, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 65, - "line": 1, - "offset": 64, - }, - "error": "/content/0:heading Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 56, - "line": 1, - "offset": 55, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 96, - "line": 1, - "offset": 95, - }, - "error": "/content/0:heading Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - }, - Object { - "end": Object { - "column": 100, - "line": 1, - "offset": 99, - }, - "error": "/content/0:heading: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'heading-with-non-text-block.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 81, - "line": 1, - "offset": 80, - }, - "error": "/content/0:heading/content/0:rule/type should be equal to one of the allowed values: hardBreak, emoji, mention, inlineExtension, date, placeholder, text, text", - "path": "/content/0/content/0/type", - "start": Object { - "column": 75, - "line": 1, - "offset": 74, - }, - "suggestion": "Did you mean date?", - }, -] -`; - -exports[`Integration Test - shows better error for 'heading-with-non-text-inline.json 1`] = ` -Array [ - Object { - "error": "/content/0:heading/content/0:emoji/attrs should have required property 'shortName'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'heading-with-unknown-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 125, - "line": 1, - "offset": 124, - }, - "error": "/content/0:heading/attrs Property foo is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'heading-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:heading should have required property 'attrs'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'inlineExtension-with-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, - Object { - "end": Object { - "column": 102, - "line": 1, - "offset": 101, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 95, - "line": 1, - "offset": 94, - }, - }, - Object { - "end": Object { - "column": 102, - "line": 1, - "offset": 101, - }, - "error": "/content/0:paragraph/content/0:inlineExtension Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 95, - "line": 1, - "offset": 94, - }, - }, - Object { - "end": Object { - "column": 224, - "line": 1, - "offset": 223, - }, - "error": "/content/0:paragraph/content/0:inlineExtension: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'inlineExtension-without-extensionKey.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:inlineExtension/attrs should have required property 'extensionKey'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 103, - "line": 1, - "offset": 102, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'inlineExtension-without-extensionType.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:inlineExtension/attrs should have required property 'extensionType'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 103, - "line": 1, - "offset": 102, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'link-with-empty-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:link/attrs should have required property 'href'", - "path": "/content/0/content/0/marks/0/attrs", - "start": Object { - "column": 129, - "line": 1, - "offset": 128, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'link-with-unknown-attr.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:link/attrs should have required property 'href'", - "path": "/content/0/content/0/marks/0/attrs", - "start": Object { - "column": 129, - "line": 1, - "offset": 128, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'link-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:link should have required property 'attrs'", - "path": "/content/0/content/0/marks/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'list-with-blockquote.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 121, - "line": 1, - "offset": 120, - }, - "error": "/content/0:orderedList/content/0:listItem/content/0:blockquote/type should be equal to one of the allowed values: mediaSingle", - "path": "/content/0/content/0/content/0/type", - "start": Object { - "column": 109, - "line": 1, - "offset": 108, - }, - "suggestion": "Did you mean mediaSingle?", - }, -] -`; - -exports[`Integration Test - shows better error for 'list-with-codeBlock.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - "error": "/content/0:orderedList/content/0:listItem/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 134, - "line": 1, - "offset": 133, - }, - }, - Object { - "end": Object { - "column": 175, - "line": 1, - "offset": 174, - }, - "error": "/content/0:orderedList/content/0:listItem/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 168, - "line": 1, - "offset": 167, - }, - }, - Object { - "end": Object { - "column": 179, - "line": 1, - "offset": 178, - }, - "error": "/content/0:orderedList/content/0:listItem/content/0:codeBlock: anyOf should match some schema in anyOf", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 101, - "line": 1, - "offset": 100, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'listItem-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 170, - "line": 1, - "offset": 169, - }, - "error": "/content/0:bulletList/content/0:listItem Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 163, - "line": 1, - "offset": 162, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'listItem-with-empty-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 101, - "line": 1, - "offset": 100, - }, - "error": "/content/0:bulletList/content/0:listItem/content: minItems should NOT have less than 1 items", - "path": "/content/0/content/0/content", - "start": Object { - "column": 99, - "line": 1, - "offset": 98, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'listItem-with-list-as-first-child.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 121, - "line": 1, - "offset": 120, - }, - "error": "/content/0:orderedList/content/0:listItem/content/0:bulletList/type should be equal to one of the allowed values: paragraph, mediaSingle", - "path": "/content/0/content/0/content/0/type", - "start": Object { - "column": 109, - "line": 1, - "offset": 108, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'listItem-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 170, - "line": 1, - "offset": 169, - }, - "error": "/content/0:bulletList/content/0:listItem Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 163, - "line": 1, - "offset": 162, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-as-top-level-node.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - "error": "/content/0:media/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, applicationCard, decisionList, taskList, extension, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - "suggestion": "Did you mean heading?", - }, -] -`; - -exports[`Integration Test - shows better error for 'media-with-empty-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:mediaGroup/content/0:media/attrs should have required property 'type'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-with-invalid-occurrence-key-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 171, - "line": 1, - "offset": 170, - }, - "error": "/content/0:mediaGroup/content/0:media/attrs/occurrenceKey: minLength should NOT be shorter than 1 characters", - "path": "/content/0/content/0/attrs/occurrenceKey", - "start": Object { - "column": 169, - "line": 1, - "offset": 168, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 129, - "line": 1, - "offset": 128, - }, - "error": "/content/0:mediaGroup/content/0:media Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 122, - "line": 1, - "offset": 121, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-with-unknown-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 126, - "line": 1, - "offset": 125, - }, - "error": "/content/0:mediaGroup/content/0:media/attrs Property foo is not expected to be here", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 121, - "line": 1, - "offset": 120, - }, - }, - Object { - "end": Object { - "column": 113, - "line": 1, - "offset": 112, - }, - "error": "/content/0:mediaGroup/content/0:media/attrs Property id is not expected to be here", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 109, - "line": 1, - "offset": 108, - }, - }, - Object { - "end": Object { - "column": 133, - "line": 1, - "offset": 132, - }, - "error": "/content/0:mediaGroup/content/0:media/attrs: anyOf should match some schema in anyOf", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:mediaGroup/content/0:media should have required property 'attrs'", - "path": "/content/0/content/0", - "start": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-without-id-attr.json 1`] = ` -Array [ - Object { - "error": "/content/0:mediaGroup/content/0:media/attrs should have required property 'id'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'media-without-type-attr.json 1`] = ` -Array [ - Object { - "error": "/content/0:mediaGroup/content/0:media/attrs should have required property 'type'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaGroup-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - "error": "/content/0:mediaGroup/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - "suggestion": "Did you mean mediaSingle?", - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaGroup-with-empty-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - "error": "/content/0:mediaGroup/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaGroup-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:mediaGroup Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:mediaGroup Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 68, - "line": 1, - "offset": 67, - }, - "error": "/content/0:mediaGroup Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 59, - "line": 1, - "offset": 58, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - "error": "/content/0:mediaGroup Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 124, - "line": 1, - "offset": 123, - }, - }, - Object { - "end": Object { - "column": 135, - "line": 1, - "offset": 134, - }, - "error": "/content/0:mediaGroup: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaGroup-without-content.json 1`] = ` -Array [ - Object { - "error": "/content/0:mediaGroup should have required property 'content'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaSingle-with-empty-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 83, - "line": 1, - "offset": 82, - }, - "error": "/content/0:mediaSingle/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 81, - "line": 1, - "offset": 80, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaSingle-with-empty-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 72, - "line": 1, - "offset": 71, - }, - "error": "/content/0:mediaSingle/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 70, - "line": 1, - "offset": 69, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mediaSingle-with-invalid-layout-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 207, - "line": 1, - "offset": 206, - }, - "error": "/content/1:mediaSingle/type should be equal to one of the allowed values: orderedList, heading, panel, table, decisionList, taskList, bodiedExtension, codeBlock", - "path": "/content/1/type", - "start": Object { - "column": 194, - "line": 1, - "offset": 193, - }, - "suggestion": "Did you mean heading?", - }, -] -`; - -exports[`Integration Test - shows better error for 'mention-with-extra-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 140, - "line": 1, - "offset": 139, - }, - "error": "/content/0:paragraph/content/0:mention/attrs Property eyeColor is not expected to be here", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 130, - "line": 1, - "offset": 129, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mention-with-invalid-user-type.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:mention/attrs/userType should be equal to one of the allowed values: DEFAULT, SPECIAL, APP", - "path": "/content/0/content/0/attrs/userType", - "start": Object { - "column": 139, - "line": 1, - "offset": 138, - }, - "suggestion": "Did you mean SPECIAL?", - }, -] -`; - -exports[`Integration Test - shows better error for 'mention-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, - Object { - "end": Object { - "column": 138, - "line": 1, - "offset": 137, - }, - "error": "/content/0:paragraph/content/0:mention Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, - Object { - "end": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - "error": "/content/0:paragraph/content/0:mention Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 87, - "line": 1, - "offset": 86, - }, - }, - Object { - "end": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - "error": "/content/0:paragraph/content/0:mention Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 87, - "line": 1, - "offset": 86, - }, - }, - Object { - "end": Object { - "column": 142, - "line": 1, - "offset": 141, - }, - "error": "/content/0:paragraph/content/0:mention: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mention-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:mention should have required property 'attrs'", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'mono-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 120, - "line": 1, - "offset": 119, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:mono/type should be equal to one of the allowed values: link, subsup, textColor, action, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - "suggestion": "Did you mean link?", - }, -] -`; - -exports[`Integration Test - shows better error for 'orderedList-with-extra-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 256, - "line": 1, - "offset": 255, - }, - "error": "/content/0:orderedList/attrs Property reverse is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 247, - "line": 1, - "offset": 246, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'orderedList-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 235, - "line": 1, - "offset": 234, - }, - "error": "/content/0:orderedList Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 228, - "line": 1, - "offset": 227, - }, - }, - Object { - "end": Object { - "column": 235, - "line": 1, - "offset": 234, - }, - "error": "/content/0:orderedList Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 228, - "line": 1, - "offset": 227, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 235, - "line": 1, - "offset": 234, - }, - "error": "/content/0:orderedList Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 228, - "line": 1, - "offset": 227, - }, - }, - Object { - "end": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - "error": "/content/0:orderedList Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - }, - Object { - "end": Object { - "column": 235, - "line": 1, - "offset": 234, - }, - "error": "/content/0:orderedList Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 228, - "line": 1, - "offset": 227, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - "error": "/content/0:orderedList Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - "error": "/content/0:orderedList Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 255, - "line": 1, - "offset": 254, - }, - "error": "/content/0:orderedList Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 248, - "line": 1, - "offset": 247, - }, - }, - Object { - "end": Object { - "column": 259, - "line": 1, - "offset": 258, - }, - "error": "/content/0:orderedList: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'orderedList-without-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 102, - "line": 1, - "offset": 101, - }, - "error": "/content/0:orderedList/content/0:listItem/content: minItems should NOT have less than 1 items", - "path": "/content/0/content/0/content", - "start": Object { - "column": 100, - "line": 1, - "offset": 99, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-with-blockquote.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 85, - "line": 1, - "offset": 84, - }, - "error": "/content/0:panel/content/0:blockquote/type should be equal to one of the allowed values: orderedList, heading", - "path": "/content/0/content/0/type", - "start": Object { - "column": 73, - "line": 1, - "offset": 72, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-with-codeBlock.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - "error": "/content/0:panel/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - }, - Object { - "end": Object { - "column": 105, - "line": 1, - "offset": 104, - }, - "error": "/content/0:panel/content/0:codeBlock Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - }, - Object { - "end": Object { - "column": 139, - "line": 1, - "offset": 138, - }, - "error": "/content/0:panel/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 132, - "line": 1, - "offset": 131, - }, - }, - Object { - "end": Object { - "column": 139, - "line": 1, - "offset": 138, - }, - "error": "/content/0:panel/content/0:codeBlock Property marks is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 132, - "line": 1, - "offset": 131, - }, - }, - Object { - "end": Object { - "column": 143, - "line": 1, - "offset": 142, - }, - "error": "/content/0:panel/content/0:codeBlock: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 65, - "line": 1, - "offset": 64, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-with-empty-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:panel/attrs should have required property 'panelType'", - "path": "/content/0/attrs", - "start": Object { - "column": 136, - "line": 1, - "offset": 135, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 135, - "line": 1, - "offset": 134, - }, - "error": "/content/0:panel Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 128, - "line": 1, - "offset": 127, - }, - }, - Object { - "end": Object { - "column": 135, - "line": 1, - "offset": 134, - }, - "error": "/content/0:panel Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 128, - "line": 1, - "offset": 127, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 135, - "line": 1, - "offset": 134, - }, - "error": "/content/0:panel Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 128, - "line": 1, - "offset": 127, - }, - }, - Object { - "end": Object { - "column": 63, - "line": 1, - "offset": 62, - }, - "error": "/content/0:panel Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 54, - "line": 1, - "offset": 53, - }, - }, - Object { - "end": Object { - "column": 135, - "line": 1, - "offset": 134, - }, - "error": "/content/0:panel Property attrs is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 128, - "line": 1, - "offset": 127, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 63, - "line": 1, - "offset": 62, - }, - "error": "/content/0:panel Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 54, - "line": 1, - "offset": 53, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 63, - "line": 1, - "offset": 62, - }, - "error": "/content/0:panel Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 54, - "line": 1, - "offset": 53, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 164, - "line": 1, - "offset": 163, - }, - "error": "/content/0:panel Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 157, - "line": 1, - "offset": 156, - }, - }, - Object { - "end": Object { - "column": 168, - "line": 1, - "offset": 167, - }, - "error": "/content/0:panel: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-with-panel.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 80, - "line": 1, - "offset": 79, - }, - "error": "/content/0:panel/content/0:panel/type should be equal to one of the allowed values: orderedList, heading", - "path": "/content/0/content/0/type", - "start": Object { - "column": 73, - "line": 1, - "offset": 72, - }, - "suggestion": "Did you mean heading?", - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-with-unknown-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 161, - "line": 1, - "offset": 160, - }, - "error": "/content/0:panel/attrs Property foo is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 156, - "line": 1, - "offset": 155, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'panel-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:panel should have required property 'attrs'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'paragraph-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 67, - "line": 1, - "offset": 66, - }, - "error": "/content/0:paragraph Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 67, - "line": 1, - "offset": 66, - }, - "error": "/content/0:paragraph Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 67, - "line": 1, - "offset": 66, - }, - "error": "/content/0:paragraph Property content is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 58, - "line": 1, - "offset": 57, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 78, - "line": 1, - "offset": 77, - }, - "error": "/content/0:paragraph Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 71, - "line": 1, - "offset": 70, - }, - }, - Object { - "end": Object { - "column": 82, - "line": 1, - "offset": 81, - }, - "error": "/content/0:paragraph: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'paragraph-with-text-with-unknown-mark.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 127, - "line": 1, - "offset": 126, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:__unknown__/type should be equal to one of the allowed values: em, strike, strong, underline, link, subsup, textColor, action, code, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'paragraph-with-top-level-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 83, - "line": 1, - "offset": 82, - }, - "error": "/content/0:paragraph/content/0:rule/type should be equal to one of the allowed values: hardBreak, emoji, mention, inlineExtension, date, placeholder, text, text", - "path": "/content/0/content/0/type", - "start": Object { - "column": 77, - "line": 1, - "offset": 76, - }, - "suggestion": "Did you mean date?", - }, -] -`; - -exports[`Integration Test - shows better error for 'paragraph-without-content.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph should have required property 'content'", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'placeholder-with-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - }, - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - }, - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - }, - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - }, - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - }, - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:placeholder Property content is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 141, - "line": 1, - "offset": 140, - }, - }, - Object { - "end": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - "error": "/content/0:paragraph/content/0:placeholder Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, - Object { - "end": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - "error": "/content/0:paragraph/content/0:placeholder Property attrs is not expected to be here", - "path": "/content/0/content/0", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, - Object { - "end": Object { - "column": 187, - "line": 1, - "offset": 186, - }, - "error": "/content/0:paragraph/content/0:placeholder: anyOf should match some schema in anyOf", - "path": "/content/0/content/0", - "start": Object { - "column": 69, - "line": 1, - "offset": 68, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'placeholder-with-empty-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:placeholder/attrs should have required property 'text'", - "path": "/content/0/content/0/attrs", - "start": Object { - "column": 99, - "line": 1, - "offset": 98, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'rule-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 52, - "line": 1, - "offset": 51, - }, - "error": "/content/0:rule/type should be equal to one of the allowed values: mediaSingle, orderedList, heading, panel, table, applicationCard, decisionList, taskList, extension, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - "suggestion": "Did you mean table?", - }, -] -`; - -exports[`Integration Test - shows better error for 'rule-with-content.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 52, - "line": 1, - "offset": 51, - }, - "error": "/content/0:rule/type should be equal to one of the allowed values: paragraph, bulletList, mediaSingle, orderedList, heading, panel, blockquote, mediaGroup, table, decisionList, taskList, bodiedExtension, codeBlock", - "path": "/content/0/type", - "start": Object { - "column": 46, - "line": 1, - "offset": 45, - }, - "suggestion": "Did you mean table?", - }, -] -`; - -exports[`Integration Test - shows better error for 'rule-with-marks.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 60, - "line": 1, - "offset": 59, - }, - "error": "/content/0:rule Property marks is not expected to be here", - "path": "/content/0", - "start": Object { - "column": 53, - "line": 1, - "offset": 52, - }, - }, - Object { - "end": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - "error": "/content/0:rule: anyOf should match some schema in anyOf", - "path": "/content/0", - "start": Object { - "column": 38, - "line": 1, - "offset": 37, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'strike-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 122, - "line": 1, - "offset": 121, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:strike/type should be equal to one of the allowed values: link, subsup, textColor, action, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'strong-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 122, - "line": 1, - "offset": 121, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:strong/type should be equal to one of the allowed values: link, subsup, textColor, action, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - "suggestion": "Did you mean action?", - }, -] -`; - -exports[`Integration Test - shows better error for 'subsup-with-extra-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 150, - "line": 1, - "offset": 149, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:subsup/attrs Property foo is not expected to be here", - "path": "/content/0/content/0/marks/0/attrs", - "start": Object { - "column": 145, - "line": 1, - "offset": 144, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'subsup-with-invalid-type-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 144, - "line": 1, - "offset": 143, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:subsup/attrs/type should be equal to one of the allowed values: sub, sup", - "path": "/content/0/content/0/marks/0/attrs/type", - "start": Object { - "column": 139, - "line": 1, - "offset": 138, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'subsup-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:subsup should have required property 'attrs'", - "path": "/content/0/content/0/marks/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'subsup-without-type-attr.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:subsup/attrs should have required property 'type'", - "path": "/content/0/content/0/marks/0/attrs", - "start": Object { - "column": 131, - "line": 1, - "offset": 130, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'table-with-nested-table.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 362, - "line": 1, - "offset": 361, - }, - "error": "/content/0:table/content/0:tableRow/content: anyOf should match some schema in anyOf", - "path": "/content/0/content/0/content", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'table-without-cells.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - "error": "/content/0:table/content/0:tableRow/content: type should be array", - "path": "/content/0/content/0/content", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, - Object { - "end": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - "error": "/content/0:table/content/0:tableRow/content: type should be array", - "path": "/content/0/content/0/content", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, - Object { - "end": Object { - "column": 98, - "line": 1, - "offset": 97, - }, - "error": "/content/0:table/content/0:tableRow/content: anyOf should match some schema in anyOf", - "path": "/content/0/content/0/content", - "start": Object { - "column": 94, - "line": 1, - "offset": 93, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'table-without-rows.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 66, - "line": 1, - "offset": 65, - }, - "error": "/content/0:table/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 64, - "line": 1, - "offset": 63, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'task-with-blockquote.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 208, - "line": 1, - "offset": 207, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote Property content is not expected to be here", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 199, - "line": 1, - "offset": 198, - }, - }, - Object { - "end": Object { - "column": 227, - "line": 1, - "offset": 226, - }, - "error": "/content/0:taskList/content/0:taskItem/content/0:blockquote: anyOf should match some schema in anyOf", - "path": "/content/0/content/0/content/0", - "start": Object { - "column": 178, - "line": 1, - "offset": 177, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'task-with-invalid-state.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 165, - "line": 1, - "offset": 164, - }, - "error": "/content/0:taskList/content/0:taskItem/attrs/state should be equal to one of the allowed values: TODO, DONE", - "path": "/content/0/content/0/attrs/state", - "start": Object { - "column": 159, - "line": 1, - "offset": 158, - }, - "suggestion": "Did you mean DONE?", - }, -] -`; - -exports[`Integration Test - shows better error for 'taskList-with-empty-task.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 73, - "line": 1, - "offset": 72, - }, - "error": "/content/0:taskList/attrs Property order is not expected to be here", - "path": "/content/0/attrs", - "start": Object { - "column": 66, - "line": 1, - "offset": 65, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'taskList-with-no-task.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 89, - "line": 1, - "offset": 88, - }, - "error": "/content/0:taskList/content: minItems should NOT have less than 1 items", - "path": "/content/0/content", - "start": Object { - "column": 87, - "line": 1, - "offset": 86, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'text-empty.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 93, - "line": 1, - "offset": 92, - }, - "error": "/content/0:paragraph/content/0:text/text: minLength should NOT be shorter than 1 characters", - "path": "/content/0/content/0/text", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, - Object { - "end": Object { - "column": 93, - "line": 1, - "offset": 92, - }, - "error": "/content/0:paragraph/content/0:text/text: minLength should NOT be shorter than 1 characters", - "path": "/content/0/content/0/text", - "start": Object { - "column": 91, - "line": 1, - "offset": 90, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'textColor-with-extra-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 158, - "line": 1, - "offset": 157, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:textColor/attrs Property foo is not expected to be here", - "path": "/content/0/content/0/marks/0/attrs", - "start": Object { - "column": 153, - "line": 1, - "offset": 152, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'textColor-with-invalid-color-attr.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 152, - "line": 1, - "offset": 151, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:textColor/attrs/color: pattern should match pattern \\"^#[0-9a-f]{6}$\\"", - "path": "/content/0/content/0/marks/0/attrs/color", - "start": Object { - "column": 143, - "line": 1, - "offset": 142, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'textColor-without-attrs.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:textColor should have required property 'attrs'", - "path": "/content/0/content/0/marks/0", - "start": Object { - "column": 106, - "line": 1, - "offset": 105, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'textColor-without-color-attr.json 1`] = ` -Array [ - Object { - "error": "/content/0:paragraph/content/0:text/marks/0:textColor/attrs should have required property 'color'", - "path": "/content/0/content/0/marks/0/attrs", - "start": Object { - "column": 134, - "line": 1, - "offset": 133, - }, - }, -] -`; - -exports[`Integration Test - shows better error for 'underline-with-attrs.json 1`] = ` -Array [ - Object { - "end": Object { - "column": 125, - "line": 1, - "offset": 124, - }, - "error": "/content/0:paragraph/content/0:text/marks/0:underline/type should be equal to one of the allowed values: link, subsup, textColor, action, link", - "path": "/content/0/content/0/marks/0/type", - "start": Object { - "column": 114, - "line": 1, - "offset": 113, - }, - }, -] -`; diff --git a/src/__tests__/integration/adfSchema.json b/src/__tests__/integration/adfSchema.json deleted file mode 100644 index c3c4593b..00000000 --- a/src/__tests__/integration/adfSchema.json +++ /dev/null @@ -1,1582 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Schema for Atlassian Document Format.", - "$ref": "#/definitions/doc_node", - "definitions": { - "paragraph_node": { - "type": "object", - "properties": { - "type": { - "enum": ["paragraph"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/inline_node" - } - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "bulletList_node": { - "type": "object", - "properties": { - "type": { - "enum": ["bulletList"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/listItem_node" - }, - "minItems": 1 - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "media_node": { - "type": "object", - "properties": { - "type": { - "enum": ["media"] - }, - "attrs": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "enum": ["link", "file"] - }, - "id": { - "type": "string", - "minLength": 1 - }, - "collection": { - "type": "string" - }, - "height": { - "type": "number" - }, - "width": { - "type": "number" - }, - "occurrenceKey": { - "type": "string", - "minLength": 1 - } - }, - "required": ["type", "id", "collection"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "type": { - "enum": ["external"] - }, - "url": { - "type": "string" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - } - }, - "required": ["type", "url"], - "additionalProperties": false - } - ] - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "mediaSingle_node": { - "type": "object", - "properties": { - "type": { - "enum": ["mediaSingle"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/media_node" - }, - "minItems": 1, - "maxItems": 1 - }, - "attrs": { - "type": "object", - "properties": { - "layout": { - "enum": [ - "wrap-right", - "center", - "wrap-left", - "wide", - "full-width" - ] - } - }, - "required": ["layout"], - "additionalProperties": false - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "listItem_node": { - "type": "object", - "properties": { - "type": { - "enum": ["listItem"] - }, - "content": { - "type": "array", - "items": [ - { - "anyOf": [ - { - "$ref": "#/definitions/paragraph_node" - }, - { - "$ref": "#/definitions/mediaSingle_node" - } - ] - }, - { - "anyOf": [ - { - "$ref": "#/definitions/paragraph_node" - }, - { - "$ref": "#/definitions/bulletList_node" - }, - { - "$ref": "#/definitions/mediaSingle_node" - }, - { - "$ref": "#/definitions/orderedList_node" - } - ] - } - ], - "minItems": 1 - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "orderedList_node": { - "type": "object", - "properties": { - "type": { - "enum": ["orderedList"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/listItem_node" - }, - "minItems": 1 - }, - "attrs": { - "type": "object", - "properties": { - "order": { - "type": "number", - "minimum": 1 - } - }, - "required": ["order"], - "additionalProperties": false - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "heading_node": { - "type": "object", - "properties": { - "type": { - "enum": ["heading"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/inline_node" - }, - "minItems": 0 - }, - "attrs": { - "type": "object", - "properties": { - "level": { - "type": "number", - "minimum": 1, - "maximum": 6 - } - }, - "required": ["level"], - "additionalProperties": false - } - }, - "required": ["type", "content", "attrs"], - "additionalProperties": false - }, - "panel_node": { - "type": "object", - "properties": { - "type": { - "enum": ["panel"] - }, - "attrs": { - "type": "object", - "properties": { - "panelType": { - "enum": ["info", "note", "tip", "warning", "error", "success"] - } - }, - "required": ["panelType"], - "additionalProperties": false - }, - "content": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/paragraph_node" - }, - { - "$ref": "#/definitions/bulletList_node" - }, - { - "$ref": "#/definitions/orderedList_node" - }, - { - "$ref": "#/definitions/heading_node" - } - ] - }, - "minItems": 1 - } - }, - "required": ["type", "attrs", "content"], - "additionalProperties": false - }, - "blockquote_node": { - "type": "object", - "properties": { - "type": { - "enum": ["blockquote"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/paragraph_node" - }, - "minItems": 1 - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "rule_node": { - "type": "object", - "properties": { - "type": { - "enum": ["rule"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "em_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["em"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "code_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["code"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "strike_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["strike"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "strong_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["strong"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "underline_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["underline"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "link_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["link"] - }, - "attrs": { - "type": "object", - "properties": { - "href": { - "type": "string" - }, - "title": { - "type": "string" - }, - "id": { - "type": "string" - }, - "collection": { - "type": "string" - }, - "occurrenceKey": { - "type": "string" - } - }, - "required": ["href"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "subsup_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["subsup"] - }, - "attrs": { - "type": "object", - "properties": { - "type": { - "enum": ["sub", "sup"] - } - }, - "required": ["type"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "textColor_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["textColor"] - }, - "attrs": { - "type": "object", - "properties": { - "color": { - "type": "string", - "pattern": "^#[0-9a-f]{6}$" - } - }, - "required": ["color"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "action_mark": { - "type": "object", - "properties": { - "type": { - "enum": ["action"] - }, - "attrs": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "key": { - "type": "string" - }, - "target": { - "type": "object", - "properties": { - "receiver": { - "type": "string" - }, - "key": { - "type": "string" - } - }, - "additionalProperties": false, - "required": ["key"] - }, - "parameters": {} - }, - "required": ["title", "target"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "hardBreak_node": { - "type": "object", - "properties": { - "type": { - "enum": ["hardBreak"] - }, - "attrs": { - "type": "object", - "properties": { - "text": { - "enum": ["\n"] - } - }, - "additionalProperties": false - } - }, - "required": ["type"], - "additionalProperties": false - }, - "emoji_node": { - "type": "object", - "properties": { - "type": { - "enum": ["emoji"] - }, - "attrs": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "shortName": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "additionalProperties": false, - "required": ["shortName"] - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "mention_node": { - "type": "object", - "properties": { - "type": { - "enum": ["mention"] - }, - "attrs": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "userType": { - "enum": ["DEFAULT", "SPECIAL", "APP"] - }, - "accessLevel": { - "type": "string" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "text_node": { - "type": "object", - "properties": { - "type": { - "enum": ["text"] - }, - "text": { - "type": "string", - "minLength": 1 - }, - "marks": { - "type": "array" - } - }, - "required": ["type", "text"], - "additionalProperties": false - }, - "mediaGroup_node": { - "type": "object", - "properties": { - "type": { - "enum": ["mediaGroup"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/media_node" - }, - "minItems": 1 - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "table_node": { - "type": "object", - "properties": { - "type": { - "enum": ["table"] - }, - "attrs": { - "type": "object", - "properties": { - "isNumberColumnEnabled": { - "type": "boolean" - }, - "layout": { - "enum": ["wide", "full-width", "default"] - } - }, - "additionalProperties": false - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/table_row_node" - }, - "minItems": 1 - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "table_row_node": { - "type": "object", - "properties": { - "type": { - "enum": ["tableRow"] - }, - "content": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/definitions/table_header_node" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/table_cell_node" - } - } - ] - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "table_cell_node": { - "type": "object", - "properties": { - "type": { - "enum": ["tableCell"] - }, - "attrs": { - "type": "object", - "properties": { - "colspan": { - "type": "number" - }, - "rowspan": { - "type": "number" - }, - "colwidth": { - "type": "array", - "items": { - "type": "number" - } - }, - "background": { - "type": "string" - } - }, - "additionalProperties": false - }, - "content": { - "$ref": "#/definitions/table_cell_content" - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "table_header_node": { - "type": "object", - "properties": { - "type": { - "enum": ["tableHeader"] - }, - "attrs": { - "type": "object", - "properties": { - "colspan": { - "type": "number" - }, - "rowspan": { - "type": "number" - }, - "colwidth": { - "type": "array", - "items": { - "type": "number" - } - }, - "background": { - "type": "string" - } - }, - "additionalProperties": false - }, - "content": { - "$ref": "#/definitions/table_cell_content" - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "applicationCard_node": { - "type": "object", - "properties": { - "type": { - "enum": ["applicationCard"] - }, - "attrs": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "textUrl": { - "type": "string" - }, - "link": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https?://|^data:image/" - } - }, - "required": ["url"], - "additionalProperties": false - }, - "background": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https://|^data:image/" - } - }, - "required": ["url"], - "additionalProperties": false - }, - "collapsible": { - "type": "boolean" - }, - "preview": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https://|^data:image/" - } - }, - "required": ["url"], - "additionalProperties": false - }, - "title": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "user": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "icon": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https://|^data:image/" - }, - "label": { - "type": "string" - } - }, - "required": ["url", "label"], - "additionalProperties": false - } - }, - "additionalProperties": false, - "required": ["icon"] - } - }, - "required": ["text"], - "additionalProperties": false - }, - "description": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "text": { - "type": "string" - }, - "icon": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https://|^data:image/" - }, - "label": { - "type": "string" - } - }, - "required": ["url", "label"], - "additionalProperties": false - }, - "badge": { - "type": "object", - "properties": { - "value": { - "type": "number" - }, - "max": { - "type": "number" - }, - "theme": { - "enum": ["default", "dark"] - }, - "appearance": { - "enum": [ - "default", - "primary", - "important", - "added", - "removed" - ] - } - }, - "required": ["value"], - "additionalProperties": false - }, - "lozenge": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "bold": { - "type": "boolean" - }, - "appearance": { - "enum": [ - "success", - "default", - "removed", - "inprogress", - "new", - "moved" - ] - } - }, - "required": ["text"], - "additionalProperties": false - }, - "users": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "icon": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https://|^data:image/" - }, - "label": { - "type": "string" - } - }, - "required": ["url", "label"], - "additionalProperties": false - } - }, - "additionalProperties": false, - "required": ["icon"] - } - } - }, - "additionalProperties": false - } - }, - "actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "target": { - "type": "object", - "properties": { - "receiver": { - "type": "string" - }, - "key": { - "type": "string" - } - }, - "additionalProperties": false, - "required": ["key"] - }, - "parameters": {} - }, - "additionalProperties": false, - "required": ["title", "target"] - } - }, - "context": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "icon": { - "type": "object", - "properties": { - "url": { - "type": "string", - "pattern": "^https://|^data:image/" - }, - "label": { - "type": "string" - } - }, - "required": ["url", "label"], - "additionalProperties": false - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["text", "title"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "decisionItem_node": { - "type": "object", - "properties": { - "type": { - "enum": ["decisionItem"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/inline_node" - } - }, - "attrs": { - "type": "object", - "properties": { - "localId": { - "type": "string" - }, - "state": { - "type": "string" - } - }, - "required": ["localId", "state"], - "additionalProperties": false - } - }, - "required": ["type", "content", "attrs"], - "additionalProperties": false - }, - "decisionList_node": { - "type": "object", - "properties": { - "type": { - "enum": ["decisionList"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/decisionItem_node" - }, - "minItems": 1 - }, - "attrs": { - "type": "object", - "properties": { - "localId": { - "type": "string" - } - }, - "required": ["localId"], - "additionalProperties": false - } - }, - "required": ["type", "content", "attrs"], - "additionalProperties": false - }, - "taskItem_node": { - "type": "object", - "properties": { - "type": { - "enum": ["taskItem"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/inline_node" - } - }, - "attrs": { - "type": "object", - "properties": { - "localId": { - "type": "string" - }, - "state": { - "enum": ["TODO", "DONE"] - } - }, - "required": ["localId", "state"], - "additionalProperties": false - } - }, - "required": ["type", "content", "attrs"], - "additionalProperties": false - }, - "taskList_node": { - "type": "object", - "properties": { - "type": { - "enum": ["taskList"] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/taskItem_node" - }, - "minItems": 1 - }, - "attrs": { - "type": "object", - "properties": { - "localId": { - "type": "string" - } - }, - "required": ["localId"], - "additionalProperties": false - } - }, - "required": ["type", "content", "attrs"], - "additionalProperties": false - }, - "extension_node": { - "type": "object", - "properties": { - "type": { - "enum": ["extension"] - }, - "attrs": { - "type": "object", - "properties": { - "extensionKey": { - "type": "string", - "minLength": 1 - }, - "extensionType": { - "type": "string", - "minLength": 1 - }, - "parameters": {}, - "text": { - "type": "string" - }, - "layout": { - "enum": ["wide", "full-width", "default"] - } - }, - "required": ["extensionKey", "extensionType"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "inlineExtension_node": { - "type": "object", - "properties": { - "type": { - "enum": ["inlineExtension"] - }, - "attrs": { - "type": "object", - "properties": { - "extensionKey": { - "type": "string", - "minLength": 1 - }, - "extensionType": { - "type": "string", - "minLength": 1 - }, - "parameters": {}, - "text": { - "type": "string" - } - }, - "required": ["extensionKey", "extensionType"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "bodiedExtension_node": { - "type": "object", - "properties": { - "type": { - "enum": ["bodiedExtension"] - }, - "attrs": { - "type": "object", - "properties": { - "extensionKey": { - "type": "string", - "minLength": 1 - }, - "extensionType": { - "type": "string", - "minLength": 1 - }, - "parameters": {}, - "text": { - "type": "string" - }, - "layout": { - "enum": ["wide", "full-width", "default"] - } - }, - "required": ["extensionKey", "extensionType"], - "additionalProperties": false - }, - "content": { - "$ref": "#/definitions/extension_content" - } - }, - "required": ["type", "attrs", "content"], - "additionalProperties": false - }, - "date_node": { - "type": "object", - "properties": { - "type": { - "enum": ["date"] - }, - "attrs": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "minLength": 1 - } - }, - "required": ["timestamp"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "placeholder_node": { - "type": "object", - "properties": { - "type": { - "enum": ["placeholder"] - }, - "attrs": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["type", "attrs"], - "additionalProperties": false - }, - "codeBlock_node": { - "type": "object", - "properties": { - "type": { - "enum": ["codeBlock"] - }, - "content": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/definitions/text_node" - }, - { - "type": "object", - "properties": { - "marks": { - "type": "array", - "maxItems": 0 - } - }, - "additionalProperties": true - } - ] - } - }, - "attrs": { - "type": "object", - "properties": { - "language": { - "enum": [ - "abap", - "actionscript", - "ada", - "arduino", - "autoit", - "c", - "c++", - "clojure", - "coffeescript", - "csharp", - "css", - "cuda", - "d", - "dart", - "delphi", - "elixir", - "erlang", - "fortran", - "foxpro", - "go", - "groovy", - "haskell", - "haxe", - "html", - "java", - "javascript", - "json", - "julia", - "kotlin", - "latex", - "livescript", - "lua", - "mathematica", - "matlab", - "objective-c", - "objective-j", - "objectpascal", - "ocaml", - "octave", - "perl", - "php", - "powershell", - "prolog", - "puppet", - "python", - "qml", - "r", - "racket", - "restructuredtext", - "ruby", - "rust", - "sass", - "scala", - "scheme", - "shell", - "smalltalk", - "sql", - "standardml", - "swift", - "tcl", - "tex", - "typescript", - "vala", - "vbnet", - "verilog", - "vhdl", - "xml", - "xquery" - ] - } - }, - "additionalProperties": false - } - }, - "required": ["type"], - "additionalProperties": false - }, - "top_level_node": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/paragraph_node" - }, - { - "$ref": "#/definitions/bulletList_node" - }, - { - "$ref": "#/definitions/mediaSingle_node" - }, - { - "$ref": "#/definitions/orderedList_node" - }, - { - "$ref": "#/definitions/heading_node" - }, - { - "$ref": "#/definitions/panel_node" - }, - { - "$ref": "#/definitions/blockquote_node" - }, - { - "$ref": "#/definitions/rule_node" - }, - { - "$ref": "#/definitions/mediaGroup_node" - }, - { - "$ref": "#/definitions/table_node" - }, - { - "$ref": "#/definitions/applicationCard_node" - }, - { - "$ref": "#/definitions/decisionList_node" - }, - { - "$ref": "#/definitions/taskList_node" - }, - { - "$ref": "#/definitions/extension_node" - }, - { - "$ref": "#/definitions/bodiedExtension_node" - }, - { - "$ref": "#/definitions/codeBlock_node" - } - ] - }, - "minItems": 1 - }, - "table_cell_content": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/paragraph_node" - }, - { - "$ref": "#/definitions/bulletList_node" - }, - { - "$ref": "#/definitions/mediaSingle_node" - }, - { - "$ref": "#/definitions/orderedList_node" - }, - { - "$ref": "#/definitions/heading_node" - }, - { - "$ref": "#/definitions/panel_node" - }, - { - "$ref": "#/definitions/blockquote_node" - }, - { - "$ref": "#/definitions/rule_node" - }, - { - "$ref": "#/definitions/mediaGroup_node" - }, - { - "$ref": "#/definitions/applicationCard_node" - }, - { - "$ref": "#/definitions/decisionList_node" - }, - { - "$ref": "#/definitions/taskList_node" - }, - { - "$ref": "#/definitions/extension_node" - }, - { - "$ref": "#/definitions/codeBlock_node" - } - ] - }, - "minItems": 1 - }, - "extension_content": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/paragraph_node" - }, - { - "$ref": "#/definitions/bulletList_node" - }, - { - "$ref": "#/definitions/mediaSingle_node" - }, - { - "$ref": "#/definitions/orderedList_node" - }, - { - "$ref": "#/definitions/heading_node" - }, - { - "$ref": "#/definitions/panel_node" - }, - { - "$ref": "#/definitions/blockquote_node" - }, - { - "$ref": "#/definitions/rule_node" - }, - { - "$ref": "#/definitions/mediaGroup_node" - }, - { - "$ref": "#/definitions/table_node" - }, - { - "$ref": "#/definitions/applicationCard_node" - }, - { - "$ref": "#/definitions/decisionList_node" - }, - { - "$ref": "#/definitions/taskList_node" - }, - { - "$ref": "#/definitions/extension_node" - }, - { - "$ref": "#/definitions/codeBlock_node" - } - ] - }, - "minItems": 1 - }, - "formatted_text_inline_node": { - "allOf": [ - { - "$ref": "#/definitions/text_node" - }, - { - "type": "object", - "properties": { - "marks": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/em_mark" - }, - { - "$ref": "#/definitions/strike_mark" - }, - { - "$ref": "#/definitions/strong_mark" - }, - { - "$ref": "#/definitions/underline_mark" - }, - { - "$ref": "#/definitions/link_mark" - }, - { - "$ref": "#/definitions/subsup_mark" - }, - { - "$ref": "#/definitions/textColor_mark" - }, - { - "$ref": "#/definitions/action_mark" - } - ] - } - } - }, - "additionalProperties": true - } - ] - }, - "code_inline_node": { - "allOf": [ - { - "$ref": "#/definitions/text_node" - }, - { - "type": "object", - "properties": { - "marks": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/code_mark" - }, - { - "$ref": "#/definitions/link_mark" - } - ] - } - } - }, - "additionalProperties": true - } - ] - }, - "inline_node": { - "anyOf": [ - { - "$ref": "#/definitions/hardBreak_node" - }, - { - "$ref": "#/definitions/emoji_node" - }, - { - "$ref": "#/definitions/mention_node" - }, - { - "$ref": "#/definitions/inlineExtension_node" - }, - { - "$ref": "#/definitions/date_node" - }, - { - "$ref": "#/definitions/placeholder_node" - }, - { - "$ref": "#/definitions/formatted_text_inline_node" - }, - { - "$ref": "#/definitions/code_inline_node" - } - ] - }, - "doc_node": { - "type": "object", - "properties": { - "version": { - "enum": [1] - }, - "type": { - "enum": ["doc"] - }, - "content": { - "$ref": "#/definitions/top_level_node" - } - }, - "required": ["version", "type", "content"], - "additionalProperties": false - } - } -} diff --git a/src/__tests__/integration/index.js b/src/__tests__/integration/index.js deleted file mode 100644 index 053a2696..00000000 --- a/src/__tests__/integration/index.js +++ /dev/null @@ -1,35 +0,0 @@ -import * as adfSchema from './adfSchema.json'; -import Ajv from 'ajv'; -import betterAjvErrors from '../..'; -import fs from 'fs'; - -const ajv = new Ajv({ jsonPointers: true, schemaId: 'auto' }); -ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); -const validate = ajv.compile(adfSchema); - -const readFilesSync = path => { - return fs.readdirSync(path).reduce((acc, name) => { - if (name.match(/\.json$/)) { - acc.push({ - name, - data: JSON.parse(fs.readFileSync(`${path}/${name}`, 'utf-8')), - }); - } - - return acc; - }, []); -}; - -describe('Integration Test - ', () => { - const invalid = readFilesSync(`${__dirname}/invalid`); - invalid.forEach(file => { - it(`shows better error for '${file.name}`, () => { - const valid = validate(file.data); - expect(valid).toBeFalsy(); - const output = betterAjvErrors(adfSchema, file.data, validate.errors, { - format: 'js', - }); - expect(output).toMatchSnapshot(); - }); - }); -}); diff --git a/src/__tests__/integration/invalid/applicationCard-with-additional-properties.json b/src/__tests__/integration/invalid/applicationCard-with-additional-properties.json deleted file mode 100644 index 4b38f4e2..00000000 --- a/src/__tests__/integration/invalid/applicationCard-with-additional-properties.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "applicationCard", - "attrs": { - "text": "foo", - "text2": "foo", - "textUrl": "https://www.atlassian.com", - "link": { - "url": "https://www.atlassian.com" - }, - "background": { - "url": "https://www.atlassian.com" - }, - "collapsible": true, - "preview": { - "url": "https://www.atlassian.com" - }, - "title": { - "text": "foo", - "user": { - "id": "id", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - }, - "description": { - "text": "foo" - }, - "details": [ - { - "title": "foo", - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - }, - "badge": { - "value": 9, - "max": 10, - "theme": "dark", - "appearance": "removed" - }, - "lozenge": { - "text": "foo", - "bold": true, - "appearance": "default" - }, - "users": [ - { - "id": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - }, - { - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - ] - }, - { - "title": "bar" - } - ], - "context": { - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - } - } - ] -} diff --git a/src/__tests__/integration/invalid/applicationCard-with-wrong-details.json b/src/__tests__/integration/invalid/applicationCard-with-wrong-details.json deleted file mode 100644 index f5e6bcf0..00000000 --- a/src/__tests__/integration/invalid/applicationCard-with-wrong-details.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "applicationCard", - "attrs": { - "text": "foo", - "textUrl": "https://www.atlassian.com", - "link": { - "url": "https://www.atlassian.com" - }, - "background": { - "url": "https://www.atlassian.com" - }, - "collapsible": true, - "preview": { - "url": "https://www.atlassian.com" - }, - "title": { - "text": "foo", - "user": { - "id": "id", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - }, - "description": { - "text": "foo" - }, - "details": [ - { - "title": "foo", - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - }, - "badge": { - "value": 9, - "max": 10, - "theme": "dark2", - "appearance": "removed2" - }, - "lozenge": { - "text": "foo", - "bold": true, - "appearance": "default2" - }, - "users": [ - { - "id": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - }, - { - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - ] - }, - { - "title": "bar" - } - ], - "context": { - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - } - } - ] -} diff --git a/src/__tests__/integration/invalid/applicationCard-with-wrong-link.json b/src/__tests__/integration/invalid/applicationCard-with-wrong-link.json deleted file mode 100644 index 15240701..00000000 --- a/src/__tests__/integration/invalid/applicationCard-with-wrong-link.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "applicationCard", - "attrs": { - "text": "foo", - "textUrl": "https://www.atlassian.com", - "link": "https://www.atlassian.com", - "background": { - "url": "https://www.atlassian.com" - }, - "collapsible": true, - "preview": { - "url": "https://www.atlassian.com" - }, - "title": { - "text": "foo", - "user": { - "id": "id", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - }, - "description": { - "text": "foo" - }, - "details": [ - { - "title": "foo", - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - }, - "badge": { - "value": 9, - "max": 10, - "theme": "dark", - "appearance": "removed" - }, - "lozenge": { - "text": "foo", - "bold": true, - "appearance": "default" - }, - "users": [ - { - "id": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - }, - { - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - ] - }, - { - "title": "bar" - } - ], - "context": { - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - } - } - ] -} diff --git a/src/__tests__/integration/invalid/applicationCard-with-wrong-title.json b/src/__tests__/integration/invalid/applicationCard-with-wrong-title.json deleted file mode 100644 index 4fa117b2..00000000 --- a/src/__tests__/integration/invalid/applicationCard-with-wrong-title.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "applicationCard", - "attrs": { - "text": "foo", - "textUrl": "https://www.atlassian.com", - "link": { - "url": "https://www.atlassian.com" - }, - "background": { - "url": "https://www.atlassian.com" - }, - "collapsible": true, - "preview": { - "url": "https://www.atlassian.com" - }, - "title": { - "user": { - "id": "id", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - }, - "description": { - "text": "foo" - }, - "details": [ - { - "title": "foo", - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - }, - "badge": { - "value": 9, - "max": 10, - "theme": "dark", - "appearance": "removed" - }, - "lozenge": { - "text": "foo", - "bold": true, - "appearance": "default" - }, - "users": [ - { - "id": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - }, - { - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - ] - }, - { - "title": "bar" - } - ], - "context": { - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - } - } - ] -} diff --git a/src/__tests__/integration/invalid/applicationCard-without-attrs-text.json b/src/__tests__/integration/invalid/applicationCard-without-attrs-text.json deleted file mode 100644 index abbd4bfd..00000000 --- a/src/__tests__/integration/invalid/applicationCard-without-attrs-text.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "applicationCard", - "text": "foo", - "attrs": { - "textUrl": "https://www.atlassian.com", - "link": { - "url": "https://www.atlassian.com" - }, - "background": { - "url": "https://www.atlassian.com" - }, - "collapsible": true, - "preview": { - "url": "https://www.atlassian.com" - }, - "title": { - "text": "foo", - "user": { - "id": "id", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - }, - "description": { - "text": "foo" - }, - "details": [ - { - "title": "foo", - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - }, - "badge": { - "value": 9, - "max": 10, - "theme": "dark", - "appearance": "removed" - }, - "lozenge": { - "text": "foo", - "bold": true, - "appearance": "default" - }, - "users": [ - { - "id": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - }, - { - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - ] - }, - { - "title": "bar" - } - ], - "context": { - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - } - } - ] -} diff --git a/src/__tests__/integration/invalid/applicationCard-without-link-url.json b/src/__tests__/integration/invalid/applicationCard-without-link-url.json deleted file mode 100644 index fa459877..00000000 --- a/src/__tests__/integration/invalid/applicationCard-without-link-url.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "applicationCard", - "attrs": { - "text": "foo", - "textUrl": "https://www.atlassian.com", - "link": {}, - "background": { - "url": "https://www.atlassian.com" - }, - "collapsible": true, - "preview": { - "url": "https://www.atlassian.com" - }, - "title": { - "text": "foo", - "user": { - "id": "id", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - }, - "description": { - "text": "foo" - }, - "details": [ - { - "title": "foo", - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - }, - "badge": { - "value": 9, - "max": 10, - "theme": "dark", - "appearance": "removed" - }, - "lozenge": { - "text": "foo", - "bold": true, - "appearance": "default" - }, - "users": [ - { - "id": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - }, - { - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - ] - }, - { - "title": "bar" - } - ], - "context": { - "text": "foo", - "icon": { - "url": "https://www.atlassian.com", - "label": "foo" - } - } - } - } - ] -} diff --git a/src/__tests__/integration/invalid/blockQuote-with-attrs.json b/src/__tests__/integration/invalid/blockQuote-with-attrs.json deleted file mode 100644 index b97a816b..00000000 --- a/src/__tests__/integration/invalid/blockQuote-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ] -} diff --git a/src/__tests__/integration/invalid/blockQuote-with-empty-content.json b/src/__tests__/integration/invalid/blockQuote-with-empty-content.json deleted file mode 100644 index f51aa3f9..00000000 --- a/src/__tests__/integration/invalid/blockQuote-with-empty-content.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "blockquote", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/blockQuote-with-marks.json b/src/__tests__/integration/invalid/blockQuote-with-marks.json deleted file mode 100644 index 4c55136d..00000000 --- a/src/__tests__/integration/invalid/blockQuote-with-marks.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/blockQuote-without-content.json b/src/__tests__/integration/invalid/blockQuote-without-content.json deleted file mode 100644 index c447dadd..00000000 --- a/src/__tests__/integration/invalid/blockQuote-without-content.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "blockquote" - } - ] -} diff --git a/src/__tests__/integration/invalid/blockquote-with-list-inside.json b/src/__tests__/integration/invalid/blockquote-with-list-inside.json deleted file mode 100644 index 7fd96f6c..00000000 --- a/src/__tests__/integration/invalid/blockquote-with-list-inside.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json b/src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json deleted file mode 100644 index f92b0ba1..00000000 --- a/src/__tests__/integration/invalid/bodied-extension-with-nested-bodiedExtension.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bodiedExtension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro.core", - "extensionKey": "expand" - }, - "content": [ - { - "type": "bodiedExtension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro.core", - "extensionKey": "expand" - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/bodied-extension-without-content.json b/src/__tests__/integration/invalid/bodied-extension-without-content.json deleted file mode 100644 index 36b12853..00000000 --- a/src/__tests__/integration/invalid/bodied-extension-without-content.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bodiedExtension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro", - "extensionKey": "expand" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json b/src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json deleted file mode 100644 index 67f5d122..00000000 --- a/src/__tests__/integration/invalid/bodied-extension-without-extensionKey.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bodiedExtension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro" - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/bodied-extension-without-extensionType.json b/src/__tests__/integration/invalid/bodied-extension-without-extensionType.json deleted file mode 100644 index 4406b0af..00000000 --- a/src/__tests__/integration/invalid/bodied-extension-without-extensionType.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bodiedExtension", - "attrs": { - "extensionKey": "expand" - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/bulletList-with-attrs.json b/src/__tests__/integration/invalid/bulletList-with-attrs.json deleted file mode 100644 index db0d7a32..00000000 --- a/src/__tests__/integration/invalid/bulletList-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ] -} diff --git a/src/__tests__/integration/invalid/bulletList-with-empty-content.json b/src/__tests__/integration/invalid/bulletList-with-empty-content.json deleted file mode 100644 index 3ea2462f..00000000 --- a/src/__tests__/integration/invalid/bulletList-with-empty-content.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/bulletList-with-marks.json b/src/__tests__/integration/invalid/bulletList-with-marks.json deleted file mode 100644 index e6474c2e..00000000 --- a/src/__tests__/integration/invalid/bulletList-with-marks.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ], - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json b/src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json deleted file mode 100644 index 81661ec6..00000000 --- a/src/__tests__/integration/invalid/bulletList-with-not-listItem-content.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/bulletList-without-content.json b/src/__tests__/integration/invalid/bulletList-without-content.json deleted file mode 100644 index 1f45abd9..00000000 --- a/src/__tests__/integration/invalid/bulletList-without-content.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList" - } - ] -} diff --git a/src/__tests__/integration/invalid/code-and-em.json b/src/__tests__/integration/invalid/code-and-em.json deleted file mode 100644 index 3cc3bdbe..00000000 --- a/src/__tests__/integration/invalid/code-and-em.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "code" - }, - { - "type": "em" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/code-and-strike.json b/src/__tests__/integration/invalid/code-and-strike.json deleted file mode 100644 index 7c733be1..00000000 --- a/src/__tests__/integration/invalid/code-and-strike.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "code" - }, - { - "type": "strike" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/code-and-strong.json b/src/__tests__/integration/invalid/code-and-strong.json deleted file mode 100644 index 9a3df022..00000000 --- a/src/__tests__/integration/invalid/code-and-strong.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "code" - }, - { - "type": "strong" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/code-and-subsup.json b/src/__tests__/integration/invalid/code-and-subsup.json deleted file mode 100644 index db35bd34..00000000 --- a/src/__tests__/integration/invalid/code-and-subsup.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "code" - }, - { - "type": "subsup" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/code-and-underline.json b/src/__tests__/integration/invalid/code-and-underline.json deleted file mode 100644 index a51b75f7..00000000 --- a/src/__tests__/integration/invalid/code-and-underline.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "code" - }, - { - "type": "underline" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/code-with-attrs.json b/src/__tests__/integration/invalid/code-with-attrs.json deleted file mode 100644 index ed05d7d4..00000000 --- a/src/__tests__/integration/invalid/code-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "code", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/codeBlock-with-marks.json b/src/__tests__/integration/invalid/codeBlock-with-marks.json deleted file mode 100644 index 43859ad3..00000000 --- a/src/__tests__/integration/invalid/codeBlock-with-marks.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "codeBlock", - "content": [], - "attrs": { - "language": "javascript" - }, - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/codeBlock-with-non-text.json b/src/__tests__/integration/invalid/codeBlock-with-non-text.json deleted file mode 100644 index eca264e5..00000000 --- a/src/__tests__/integration/invalid/codeBlock-with-non-text.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "codeBlock", - "content": [ - { - "type": "rule" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/codeBlock-with-strong.json b/src/__tests__/integration/invalid/codeBlock-with-strong.json deleted file mode 100644 index c51b6e91..00000000 --- a/src/__tests__/integration/invalid/codeBlock-with-strong.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "codeBlock", - "content": [ - { - "type": "text", - "marks": [ - { - "type": "strong" - } - ], - "text": "foo" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json b/src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json deleted file mode 100644 index 2ac4cc45..00000000 --- a/src/__tests__/integration/invalid/codeBlock-with-unknown-attrs.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "codeBlock", - "content": [], - "attrs": { - "language": "foo" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/codeBlock-with-unknown-language.json b/src/__tests__/integration/invalid/codeBlock-with-unknown-language.json deleted file mode 100644 index 651a0e43..00000000 --- a/src/__tests__/integration/invalid/codeBlock-with-unknown-language.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "codeBlock", - "content": [], - "attrs": { - "foo": "bar" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/decision-with-blockquote.json b/src/__tests__/integration/invalid/decision-with-blockquote.json deleted file mode 100644 index a01193f2..00000000 --- a/src/__tests__/integration/invalid/decision-with-blockquote.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "decisionList", - "attrs": { - "localId": "test-list-id" - }, - "content": [ - { - "type": "decisionItem", - "attrs": { - "localId": "test-id", - "state": "DECIDED" - }, - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "rule" - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/decisionList-with-empty-decision.json b/src/__tests__/integration/invalid/decisionList-with-empty-decision.json deleted file mode 100644 index 073a2bb4..00000000 --- a/src/__tests__/integration/invalid/decisionList-with-empty-decision.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "decisionList", - "attrs": { - "order": 1, - "localId": "test-list-id" - }, - "content": [ - { - "type": "decisionItem", - "attrs": { - "localId": "test-id", - "state": "DECIDED" - }, - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/decisionList-with-no-decision.json b/src/__tests__/integration/invalid/decisionList-with-no-decision.json deleted file mode 100644 index 2e4e2066..00000000 --- a/src/__tests__/integration/invalid/decisionList-with-no-decision.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "decisionList", - "attrs": { - "order": 1 - }, - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/doc-with-attrs.json b/src/__tests__/integration/invalid/doc-with-attrs.json deleted file mode 100644 index 871d66ae..00000000 --- a/src/__tests__/integration/invalid/doc-with-attrs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "rule" - } - ], - "attrs": {} -} diff --git a/src/__tests__/integration/invalid/doc-with-empty-content.json b/src/__tests__/integration/invalid/doc-with-empty-content.json deleted file mode 100644 index 88e66459..00000000 --- a/src/__tests__/integration/invalid/doc-with-empty-content.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [] -} diff --git a/src/__tests__/integration/invalid/doc-with-marks.json b/src/__tests__/integration/invalid/doc-with-marks.json deleted file mode 100644 index f7927dd5..00000000 --- a/src/__tests__/integration/invalid/doc-with-marks.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "rule" - } - ], - "marks": [] -} diff --git a/src/__tests__/integration/invalid/doc-without-content.json b/src/__tests__/integration/invalid/doc-without-content.json deleted file mode 100644 index 342a90e6..00000000 --- a/src/__tests__/integration/invalid/doc-without-content.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": 1, - "type": "doc" -} diff --git a/src/__tests__/integration/invalid/doc-without-version.json b/src/__tests__/integration/invalid/doc-without-version.json deleted file mode 100644 index 5e1d6e4a..00000000 --- a/src/__tests__/integration/invalid/doc-without-version.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "doc", - "content": [] -} diff --git a/src/__tests__/integration/invalid/em-with-attrs.json b/src/__tests__/integration/invalid/em-with-attrs.json deleted file mode 100644 index f4af7ba8..00000000 --- a/src/__tests__/integration/invalid/em-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "em", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/emoji-as-top-level-node.json b/src/__tests__/integration/invalid/emoji-as-top-level-node.json deleted file mode 100644 index 3ffdf796..00000000 --- a/src/__tests__/integration/invalid/emoji-as-top-level-node.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "emoji", - "attrs": { - "id": "1fd" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/emoji-with-content.json b/src/__tests__/integration/invalid/emoji-with-content.json deleted file mode 100644 index e987205e..00000000 --- a/src/__tests__/integration/invalid/emoji-with-content.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "emoji", - "attrs": { - "id": "1fd" - }, - "content": [ - { - "type": "text", - "text": "" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/emoji-with-empty-attrs.json b/src/__tests__/integration/invalid/emoji-with-empty-attrs.json deleted file mode 100644 index 737cc568..00000000 --- a/src/__tests__/integration/invalid/emoji-with-empty-attrs.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "emoji", - "attrs": {} - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/emoji-with-marks.json b/src/__tests__/integration/invalid/emoji-with-marks.json deleted file mode 100644 index 73c8c3d4..00000000 --- a/src/__tests__/integration/invalid/emoji-with-marks.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "emoji", - "attrs": { - "id": "1fd" - }, - "marks": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/emoji-with-unknown-attr.json b/src/__tests__/integration/invalid/emoji-with-unknown-attr.json deleted file mode 100644 index 95286529..00000000 --- a/src/__tests__/integration/invalid/emoji-with-unknown-attr.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "emoji", - "attrs": { - "id": "1fd", - "foo": "bar" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/emoji-without-attrs.json b/src/__tests__/integration/invalid/emoji-without-attrs.json deleted file mode 100644 index 6e25d700..00000000 --- a/src/__tests__/integration/invalid/emoji-without-attrs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "emoji" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/extension-with-content.json b/src/__tests__/integration/invalid/extension-with-content.json deleted file mode 100644 index f589c2d7..00000000 --- a/src/__tests__/integration/invalid/extension-with-content.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "extension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro", - "extensionKey": "gallery" - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/extension-without-extensionKey.json b/src/__tests__/integration/invalid/extension-without-extensionKey.json deleted file mode 100644 index 0c48a1c1..00000000 --- a/src/__tests__/integration/invalid/extension-without-extensionKey.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "extension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/extension-without-extensionType.json b/src/__tests__/integration/invalid/extension-without-extensionType.json deleted file mode 100644 index 535a1c21..00000000 --- a/src/__tests__/integration/invalid/extension-without-extensionType.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "extension", - "attrs": { - "extensionKey": "gallery" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/hardBreak-with-marks.json b/src/__tests__/integration/invalid/hardBreak-with-marks.json deleted file mode 100644 index af3ce70c..00000000 --- a/src/__tests__/integration/invalid/hardBreak-with-marks.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "hardBreak", - "attrs": { - "text": "\n" - }, - "marks": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/hardBreak-with-wrong-text.json b/src/__tests__/integration/invalid/hardBreak-with-wrong-text.json deleted file mode 100644 index 45add43b..00000000 --- a/src/__tests__/integration/invalid/hardBreak-with-wrong-text.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "hardBreak", - "attrs": { - "text": "foo" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/heading-with-invalid-level-attr.json b/src/__tests__/integration/invalid/heading-with-invalid-level-attr.json deleted file mode 100644 index 15e1dc99..00000000 --- a/src/__tests__/integration/invalid/heading-with-invalid-level-attr.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "heading", - "content": [ - { - "type": "text", - "text": "Heading" - } - ], - "attrs": { - "level": 7 - } - } - ] -} diff --git a/src/__tests__/integration/invalid/heading-with-marks.json b/src/__tests__/integration/invalid/heading-with-marks.json deleted file mode 100644 index 38a16004..00000000 --- a/src/__tests__/integration/invalid/heading-with-marks.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "heading", - "content": [], - "attrs": { - "level": 1 - }, - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/heading-with-non-text-block.json b/src/__tests__/integration/invalid/heading-with-non-text-block.json deleted file mode 100644 index 8b6b0e2a..00000000 --- a/src/__tests__/integration/invalid/heading-with-non-text-block.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "heading", - "content": [ - { - "type": "rule" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/heading-with-non-text-inline.json b/src/__tests__/integration/invalid/heading-with-non-text-inline.json deleted file mode 100644 index 8ad83ce5..00000000 --- a/src/__tests__/integration/invalid/heading-with-non-text-inline.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "heading", - "content": [ - { - "type": "emoji", - "attrs": { - "id": "xxxx", - "text": ":smile:" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/heading-with-unknown-attrs.json b/src/__tests__/integration/invalid/heading-with-unknown-attrs.json deleted file mode 100644 index 45f8c1c4..00000000 --- a/src/__tests__/integration/invalid/heading-with-unknown-attrs.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "heading", - "content": [ - { - "type": "text", - "text": "Heading" - } - ], - "attrs": { - "level": 1, - "foo": "bar" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/heading-without-attrs.json b/src/__tests__/integration/invalid/heading-without-attrs.json deleted file mode 100644 index 85ea9f5f..00000000 --- a/src/__tests__/integration/invalid/heading-without-attrs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "heading", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/inlineExtension-with-content.json b/src/__tests__/integration/invalid/inlineExtension-with-content.json deleted file mode 100644 index ec20d680..00000000 --- a/src/__tests__/integration/invalid/inlineExtension-with-content.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "inlineExtension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro", - "extensionKey": "status" - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json b/src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json deleted file mode 100644 index e63cebc4..00000000 --- a/src/__tests__/integration/invalid/inlineExtension-without-extensionKey.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "inlineExtension", - "attrs": { - "extensionType": "com.atlassian.confluence.macro" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/inlineExtension-without-extensionType.json b/src/__tests__/integration/invalid/inlineExtension-without-extensionType.json deleted file mode 100644 index 9cd9ccbb..00000000 --- a/src/__tests__/integration/invalid/inlineExtension-without-extensionType.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "inlineExtension", - "attrs": { - "extensionKey": "status" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/link-with-empty-attrs.json b/src/__tests__/integration/invalid/link-with-empty-attrs.json deleted file mode 100644 index 071ee056..00000000 --- a/src/__tests__/integration/invalid/link-with-empty-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "link", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/link-with-unknown-attr.json b/src/__tests__/integration/invalid/link-with-unknown-attr.json deleted file mode 100644 index 071ee056..00000000 --- a/src/__tests__/integration/invalid/link-with-unknown-attr.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "link", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/link-without-attrs.json b/src/__tests__/integration/invalid/link-without-attrs.json deleted file mode 100644 index 2b2b27e2..00000000 --- a/src/__tests__/integration/invalid/link-without-attrs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "link" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/list-with-blockquote.json b/src/__tests__/integration/invalid/list-with-blockquote.json deleted file mode 100644 index 5fda2aca..00000000 --- a/src/__tests__/integration/invalid/list-with-blockquote.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "orderedList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/list-with-codeBlock.json b/src/__tests__/integration/invalid/list-with-codeBlock.json deleted file mode 100644 index 66b0e57f..00000000 --- a/src/__tests__/integration/invalid/list-with-codeBlock.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "orderedList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "codeBlock", - "content": [], - "attrs": { - "language": "javascript" - }, - "marks": [] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/listItem-with-attrs.json b/src/__tests__/integration/invalid/listItem-with-attrs.json deleted file mode 100644 index 8b5e61e7..00000000 --- a/src/__tests__/integration/invalid/listItem-with-attrs.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/listItem-with-empty-content.json b/src/__tests__/integration/invalid/listItem-with-empty-content.json deleted file mode 100644 index 6096b90d..00000000 --- a/src/__tests__/integration/invalid/listItem-with-empty-content.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "listItem", - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/listItem-with-list-as-first-child.json b/src/__tests__/integration/invalid/listItem-with-list-as-first-child.json deleted file mode 100644 index eb57bf36..00000000 --- a/src/__tests__/integration/invalid/listItem-with-list-as-first-child.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "orderedList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/listItem-with-marks.json b/src/__tests__/integration/invalid/listItem-with-marks.json deleted file mode 100644 index f2e15e39..00000000 --- a/src/__tests__/integration/invalid/listItem-with-marks.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "bulletList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "marks": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-as-top-level-node.json b/src/__tests__/integration/invalid/media-as-top-level-node.json deleted file mode 100644 index 5d1f7d47..00000000 --- a/src/__tests__/integration/invalid/media-as-top-level-node.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "media", - "attrs": { - "id": "1234", - "type": "file" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/media-with-empty-attrs.json b/src/__tests__/integration/invalid/media-with-empty-attrs.json deleted file mode 100644 index 7cc46096..00000000 --- a/src/__tests__/integration/invalid/media-with-empty-attrs.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": {} - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json b/src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json deleted file mode 100644 index 15e798f9..00000000 --- a/src/__tests__/integration/invalid/media-with-invalid-occurrence-key-attr.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "type": "file", - "id": "1234", - "collection": "SampleCollection", - "occurrenceKey": "" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-with-marks.json b/src/__tests__/integration/invalid/media-with-marks.json deleted file mode 100644 index d53a6c71..00000000 --- a/src/__tests__/integration/invalid/media-with-marks.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "id": "1234", - "type": "file" - }, - "marks": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-with-unknown-attr.json b/src/__tests__/integration/invalid/media-with-unknown-attr.json deleted file mode 100644 index 6af19c3d..00000000 --- a/src/__tests__/integration/invalid/media-with-unknown-attr.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "type": "file", - "id": "1234", - "foo": "bar" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-without-attrs.json b/src/__tests__/integration/invalid/media-without-attrs.json deleted file mode 100644 index f0c9588e..00000000 --- a/src/__tests__/integration/invalid/media-without-attrs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-without-id-attr.json b/src/__tests__/integration/invalid/media-without-id-attr.json deleted file mode 100644 index 93672192..00000000 --- a/src/__tests__/integration/invalid/media-without-id-attr.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "type": "file" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/media-without-type-attr.json b/src/__tests__/integration/invalid/media-without-type-attr.json deleted file mode 100644 index e3ad8562..00000000 --- a/src/__tests__/integration/invalid/media-without-type-attr.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "id": "1234" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaGroup-with-attrs.json b/src/__tests__/integration/invalid/mediaGroup-with-attrs.json deleted file mode 100644 index 3d8df806..00000000 --- a/src/__tests__/integration/invalid/mediaGroup-with-attrs.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "type": "file", - "id": "1234" - } - } - ], - "attrs": {} - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaGroup-with-empty-content.json b/src/__tests__/integration/invalid/mediaGroup-with-empty-content.json deleted file mode 100644 index 8475363a..00000000 --- a/src/__tests__/integration/invalid/mediaGroup-with-empty-content.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaGroup-with-marks.json b/src/__tests__/integration/invalid/mediaGroup-with-marks.json deleted file mode 100644 index 1219cdb9..00000000 --- a/src/__tests__/integration/invalid/mediaGroup-with-marks.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup", - "content": [ - { - "type": "media", - "attrs": { - "type": "file", - "id": "1234" - } - } - ], - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaGroup-without-content.json b/src/__tests__/integration/invalid/mediaGroup-without-content.json deleted file mode 100644 index 8a65c3cf..00000000 --- a/src/__tests__/integration/invalid/mediaGroup-without-content.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaGroup" - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json b/src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json deleted file mode 100644 index 013b0a42..00000000 --- a/src/__tests__/integration/invalid/mediaSingle-with-empty-attrs.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaSingle", - "attrs": {}, - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaSingle-with-empty-content.json b/src/__tests__/integration/invalid/mediaSingle-with-empty-content.json deleted file mode 100644 index cd427da4..00000000 --- a/src/__tests__/integration/invalid/mediaSingle-with-empty-content.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaSingle", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json b/src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json deleted file mode 100644 index 6b290db1..00000000 --- a/src/__tests__/integration/invalid/mediaSingle-with-invalid-layout-attr.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "mediaSingle", - "attrs": { - "layout": "center" - }, - "content": [ - { - "type": "media", - "attrs": { - "type": "file", - "id": "1234", - "collection": "SampleCollection" - } - } - ] - }, - { - "type": "mediaSingle", - "attrs": { - "layout": "" - }, - "content": [ - { - "type": "media", - "attrs": { - "type": "file", - "id": "1234", - "collection": "SampleCollection" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/mention-with-extra-attrs.json b/src/__tests__/integration/invalid/mention-with-extra-attrs.json deleted file mode 100644 index 5d4761c7..00000000 --- a/src/__tests__/integration/invalid/mention-with-extra-attrs.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "mention", - "attrs": { - "id": "test-id", - "text": "Test User", - "eyeColor": "brown" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/mention-with-invalid-user-type.json b/src/__tests__/integration/invalid/mention-with-invalid-user-type.json deleted file mode 100644 index 25964b17..00000000 --- a/src/__tests__/integration/invalid/mention-with-invalid-user-type.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "mention", - "attrs": { - "id": "test-rick", - "text": "@rick", - "userType": "SCIENTIST" - } - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/mention-with-marks.json b/src/__tests__/integration/invalid/mention-with-marks.json deleted file mode 100644 index 61f2049c..00000000 --- a/src/__tests__/integration/invalid/mention-with-marks.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "mention", - "attrs": { - "id": "test-id", - "text": "Test User" - }, - "marks": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/mention-without-attrs.json b/src/__tests__/integration/invalid/mention-without-attrs.json deleted file mode 100644 index e7e28177..00000000 --- a/src/__tests__/integration/invalid/mention-without-attrs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "mention" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/mono-with-attrs.json b/src/__tests__/integration/invalid/mono-with-attrs.json deleted file mode 100644 index cbf6f58c..00000000 --- a/src/__tests__/integration/invalid/mono-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "mono", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/orderedList-with-extra-attrs.json b/src/__tests__/integration/invalid/orderedList-with-extra-attrs.json deleted file mode 100644 index b452681b..00000000 --- a/src/__tests__/integration/invalid/orderedList-with-extra-attrs.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "orderedList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - }, - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ], - "attrs": { - "order": 3, - "reverse": true - } - } - ] -} diff --git a/src/__tests__/integration/invalid/orderedList-with-marks.json b/src/__tests__/integration/invalid/orderedList-with-marks.json deleted file mode 100644 index b5ac510f..00000000 --- a/src/__tests__/integration/invalid/orderedList-with-marks.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "orderedList", - "content": [ - { - "type": "listItem", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - }, - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ], - "attrs": { - "order": 3 - }, - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/orderedList-without-content.json b/src/__tests__/integration/invalid/orderedList-without-content.json deleted file mode 100644 index b72e8c5f..00000000 --- a/src/__tests__/integration/invalid/orderedList-without-content.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "orderedList", - "content": [ - { - "type": "listItem", - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-with-blockquote.json b/src/__tests__/integration/invalid/panel-with-blockquote.json deleted file mode 100644 index ac0bb9f4..00000000 --- a/src/__tests__/integration/invalid/panel-with-blockquote.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ], - "attrs": { - "panelType": "tip" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-with-codeBlock.json b/src/__tests__/integration/invalid/panel-with-codeBlock.json deleted file mode 100644 index 98f9e18b..00000000 --- a/src/__tests__/integration/invalid/panel-with-codeBlock.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "codeBlock", - "content": [], - "attrs": { - "language": "javascript" - }, - "marks": [] - } - ], - "attrs": { - "panelType": "tip" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-with-empty-attrs.json b/src/__tests__/integration/invalid/panel-with-empty-attrs.json deleted file mode 100644 index 4b559252..00000000 --- a/src/__tests__/integration/invalid/panel-with-empty-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-with-marks.json b/src/__tests__/integration/invalid/panel-with-marks.json deleted file mode 100644 index ed41db2f..00000000 --- a/src/__tests__/integration/invalid/panel-with-marks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": { - "panelType": "info" - }, - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-with-panel.json b/src/__tests__/integration/invalid/panel-with-panel.json deleted file mode 100644 index 89af1c5a..00000000 --- a/src/__tests__/integration/invalid/panel-with-panel.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": {} - } - ], - "attrs": { - "panelType": "tip" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-with-unknown-attr.json b/src/__tests__/integration/invalid/panel-with-unknown-attr.json deleted file mode 100644 index 0b27f69b..00000000 --- a/src/__tests__/integration/invalid/panel-with-unknown-attr.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ], - "attrs": { - "panelType": "info", - "foo": "bar" - } - } - ] -} diff --git a/src/__tests__/integration/invalid/panel-without-attrs.json b/src/__tests__/integration/invalid/panel-without-attrs.json deleted file mode 100644 index 99e0d5d6..00000000 --- a/src/__tests__/integration/invalid/panel-without-attrs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "panel", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/paragraph-with-marks.json b/src/__tests__/integration/invalid/paragraph-with-marks.json deleted file mode 100644 index 5a004ddc..00000000 --- a/src/__tests__/integration/invalid/paragraph-with-marks.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [], - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json b/src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json deleted file mode 100644 index bae363e7..00000000 --- a/src/__tests__/integration/invalid/paragraph-with-text-with-unknown-mark.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "foo", - "marks": [ - { - "type": "__unknown__" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/paragraph-with-top-level-content.json b/src/__tests__/integration/invalid/paragraph-with-top-level-content.json deleted file mode 100644 index f3dce934..00000000 --- a/src/__tests__/integration/invalid/paragraph-with-top-level-content.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "rule" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/paragraph-without-content.json b/src/__tests__/integration/invalid/paragraph-without-content.json deleted file mode 100644 index 42953859..00000000 --- a/src/__tests__/integration/invalid/paragraph-without-content.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph" - } - ] -} diff --git a/src/__tests__/integration/invalid/placeholder-with-content.json b/src/__tests__/integration/invalid/placeholder-with-content.json deleted file mode 100644 index e8e19950..00000000 --- a/src/__tests__/integration/invalid/placeholder-with-content.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "placeholder", - "attrs": { - "text": "Write something interesting..." - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/placeholder-with-empty-attrs.json b/src/__tests__/integration/invalid/placeholder-with-empty-attrs.json deleted file mode 100644 index 2e8f0ef2..00000000 --- a/src/__tests__/integration/invalid/placeholder-with-empty-attrs.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "placeholder", - "attrs": {} - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/rule-with-attrs.json b/src/__tests__/integration/invalid/rule-with-attrs.json deleted file mode 100644 index cdc64c0c..00000000 --- a/src/__tests__/integration/invalid/rule-with-attrs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "rule", - "attrs": {} - } - ] -} diff --git a/src/__tests__/integration/invalid/rule-with-content.json b/src/__tests__/integration/invalid/rule-with-content.json deleted file mode 100644 index 84ac6d89..00000000 --- a/src/__tests__/integration/invalid/rule-with-content.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "rule", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/rule-with-marks.json b/src/__tests__/integration/invalid/rule-with-marks.json deleted file mode 100644 index 6733526e..00000000 --- a/src/__tests__/integration/invalid/rule-with-marks.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "rule", - "marks": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/strike-with-attrs.json b/src/__tests__/integration/invalid/strike-with-attrs.json deleted file mode 100644 index 986993c7..00000000 --- a/src/__tests__/integration/invalid/strike-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "strike", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/strong-with-attrs.json b/src/__tests__/integration/invalid/strong-with-attrs.json deleted file mode 100644 index a48ff302..00000000 --- a/src/__tests__/integration/invalid/strong-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "strong", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/subsup-with-extra-attrs.json b/src/__tests__/integration/invalid/subsup-with-extra-attrs.json deleted file mode 100644 index 5a1bf0be..00000000 --- a/src/__tests__/integration/invalid/subsup-with-extra-attrs.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "subsup", - "attrs": { - "type": "sub", - "foo": "bar" - } - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json b/src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json deleted file mode 100644 index 109f46f0..00000000 --- a/src/__tests__/integration/invalid/subsup-with-invalid-type-attr.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "subsup", - "attrs": { - "type": "foo" - } - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/subsup-without-attrs.json b/src/__tests__/integration/invalid/subsup-without-attrs.json deleted file mode 100644 index 64672a45..00000000 --- a/src/__tests__/integration/invalid/subsup-without-attrs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "subsup" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/subsup-without-type-attr.json b/src/__tests__/integration/invalid/subsup-without-type-attr.json deleted file mode 100644 index 5d61a4aa..00000000 --- a/src/__tests__/integration/invalid/subsup-without-type-attr.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "subsup", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/table-with-nested-table.json b/src/__tests__/integration/invalid/table-with-nested-table.json deleted file mode 100644 index 60da684f..00000000 --- a/src/__tests__/integration/invalid/table-with-nested-table.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "table", - "content": [ - { - "type": "tableRow", - "content": [ - { - "type": "tableHeader", - "attrs": { - "colspan": 1, - "rowspan": 1, - "background": null - }, - "content": [ - { - "type": "table", - "content": [ - { - "type": "tableRow", - "content": [ - { - "type": "tableCell", - "attrs": { - "colspan": 1, - "rowspan": 1, - "background": null - }, - "content": [ - { - "type": "paragraph", - "content": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/table-without-cells.json b/src/__tests__/integration/invalid/table-without-cells.json deleted file mode 100644 index 6887cd7d..00000000 --- a/src/__tests__/integration/invalid/table-without-cells.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "table", - "content": [ - { - "type": "tableRow", - "content": null - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/table-without-rows.json b/src/__tests__/integration/invalid/table-without-rows.json deleted file mode 100644 index 5c185ed5..00000000 --- a/src/__tests__/integration/invalid/table-without-rows.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "table", - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/task-with-blockquote.json b/src/__tests__/integration/invalid/task-with-blockquote.json deleted file mode 100644 index 3dddd266..00000000 --- a/src/__tests__/integration/invalid/task-with-blockquote.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "taskList", - "attrs": { - "localId": "test-list-id" - }, - "content": [ - { - "type": "taskItem", - "attrs": { - "localId": "test-id", - "state": "TODO" - }, - "content": [ - { - "type": "blockquote", - "content": [ - { - "type": "rule" - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/task-with-invalid-state.json b/src/__tests__/integration/invalid/task-with-invalid-state.json deleted file mode 100644 index 608a93ed..00000000 --- a/src/__tests__/integration/invalid/task-with-invalid-state.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "taskList", - "attrs": { - "localId": "test-list-id" - }, - "content": [ - { - "type": "taskItem", - "attrs": { - "localId": "test-id", - "state": "NOPE" - }, - "content": [ - { - "type": "text", - "text": "Nope" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/taskList-with-empty-task.json b/src/__tests__/integration/invalid/taskList-with-empty-task.json deleted file mode 100644 index 07b82a03..00000000 --- a/src/__tests__/integration/invalid/taskList-with-empty-task.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "taskList", - "attrs": { - "order": 1, - "localId": "test-list-id" - }, - "content": [ - { - "type": "taskItem", - "attrs": { - "localId": "test-id", - "state": "TODO" - }, - "content": [] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/taskList-with-no-task.json b/src/__tests__/integration/invalid/taskList-with-no-task.json deleted file mode 100644 index 63b4f504..00000000 --- a/src/__tests__/integration/invalid/taskList-with-no-task.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "taskList", - "attrs": { - "order": 1 - }, - "content": [] - } - ] -} diff --git a/src/__tests__/integration/invalid/text-empty.json b/src/__tests__/integration/invalid/text-empty.json deleted file mode 100644 index 3a9b77bd..00000000 --- a/src/__tests__/integration/invalid/text-empty.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "" - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/textColor-with-extra-attrs.json b/src/__tests__/integration/invalid/textColor-with-extra-attrs.json deleted file mode 100644 index 35fb8a63..00000000 --- a/src/__tests__/integration/invalid/textColor-with-extra-attrs.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "textColor", - "attrs": { - "color": "#97a0af", - "foo": "bar" - } - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json b/src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json deleted file mode 100644 index 1aaa9c31..00000000 --- a/src/__tests__/integration/invalid/textColor-with-invalid-color-attr.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "textColor", - "attrs": { - "color": "#fffffF" - } - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/textColor-without-attrs.json b/src/__tests__/integration/invalid/textColor-without-attrs.json deleted file mode 100644 index 1e49f3e7..00000000 --- a/src/__tests__/integration/invalid/textColor-without-attrs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "textColor" - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/textColor-without-color-attr.json b/src/__tests__/integration/invalid/textColor-without-color-attr.json deleted file mode 100644 index 7be9f4bf..00000000 --- a/src/__tests__/integration/invalid/textColor-without-color-attr.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "textColor", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/__tests__/integration/invalid/underline-with-attrs.json b/src/__tests__/integration/invalid/underline-with-attrs.json deleted file mode 100644 index c9c956b7..00000000 --- a/src/__tests__/integration/invalid/underline-with-attrs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "type": "doc", - "content": [ - { - "type": "paragraph", - "content": [ - { - "type": "text", - "text": "Foo", - "marks": [ - { - "type": "underline", - "attrs": {} - } - ] - } - ] - } - ] -} diff --git a/src/json/get-decorated-data-pah.js b/src/json/get-decorated-data-pah.js index 9d9e38b0..8a0424a4 100644 --- a/src/json/get-decorated-data-pah.js +++ b/src/json/get-decorated-data-pah.js @@ -1,4 +1,4 @@ -export default function getMetaFromPath(jsonAst, dataPath) { +export default function getDecoratedDataPath(jsonAst, dataPath) { // TODO: Handle json pointer escape notation and better error handling const pointers = dataPath.split('/').slice(1); let decoratedPath = ''; diff --git a/src/json/get-meta-from-path.js b/src/json/get-meta-from-path.js index d2183512..e871a517 100644 --- a/src/json/get-meta-from-path.js +++ b/src/json/get-meta-from-path.js @@ -6,11 +6,9 @@ export default function getMetaFromPath( // TODO: Handle json pointer escape notation and better error handling const pointers = dataPath.split('/').slice(1); const lastPointerIndex = pointers.length - 1; - let decoratedPath = ''; return pointers.reduce((obj, pointer, idx) => { switch (obj.type) { case 'Object': { - decoratedPath += `/${pointer}`; const filtered = obj.children.filter( child => child.key.value === pointer ); @@ -21,7 +19,6 @@ export default function getMetaFromPath( return isIdentifierLocation && idx === lastPointerIndex ? key : value; } case 'Array': - decoratedPath += `/${pointer}(${getTypeName(obj.children[pointer])})`; return obj.children[pointer]; default: // eslint-disable-next-line no-console @@ -29,13 +26,3 @@ export default function getMetaFromPath( } }, jsonAst); } - -function getTypeName(obj) { - const type = obj.children.filter(child => child.key.value === 'type'); - - if (!type.length) { - return ''; - } - - return (type[0].value && type[0].value.value) || ''; -}