From 12936f336350ffa1bf9dcad33e8356b3f5bc5d57 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 17 Oct 2022 13:18:02 +0300 Subject: [PATCH] generate fixtures --- .../fixtures/blocks/core__form.html | 21 +++++ .../fixtures/blocks/core__form.json | 68 ++++++++++++++ .../fixtures/blocks/core__form.parsed.json | 88 +++++++++++++++++ .../blocks/core__form.serialized.html | 21 +++++ .../fixtures/blocks/core__input-field.html | 19 ++++ .../fixtures/blocks/core__input-field.json | 57 +++++++++++ .../blocks/core__input-field.parsed.json | 94 +++++++++++++++++++ .../blocks/core__input-field.serialized.html | 19 ++++ 8 files changed, 387 insertions(+) create mode 100644 test/integration/fixtures/blocks/core__form.html create mode 100644 test/integration/fixtures/blocks/core__form.json create mode 100644 test/integration/fixtures/blocks/core__form.parsed.json create mode 100644 test/integration/fixtures/blocks/core__form.serialized.html create mode 100644 test/integration/fixtures/blocks/core__input-field.html create mode 100644 test/integration/fixtures/blocks/core__input-field.json create mode 100644 test/integration/fixtures/blocks/core__input-field.parsed.json create mode 100644 test/integration/fixtures/blocks/core__input-field.serialized.html diff --git a/test/integration/fixtures/blocks/core__form.html b/test/integration/fixtures/blocks/core__form.html new file mode 100644 index 0000000000000..9015fe38dd19c --- /dev/null +++ b/test/integration/fixtures/blocks/core__form.html @@ -0,0 +1,21 @@ + +
+ + + + + + + + + + + + + + + + +
+
+ diff --git a/test/integration/fixtures/blocks/core__form.json b/test/integration/fixtures/blocks/core__form.json new file mode 100644 index 0000000000000..0c9f29ac87ee0 --- /dev/null +++ b/test/integration/fixtures/blocks/core__form.json @@ -0,0 +1,68 @@ +[ + { + "name": "core/form", + "isValid": true, + "attributes": { + "action": "#", + "method": "post", + "formId": "the-form-id" + }, + "innerBlocks": [ + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "text", + "label": "Name - required, inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "checkbox", + "label": "Checkbox - inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "email", + "label": "Email - required", + "inlineLabel": false, + "required": true + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "textarea", + "label": "Textarea input", + "inlineLabel": false, + "required": false + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "submit", + "label": "Submit", + "inlineLabel": false, + "required": false + }, + "innerBlocks": [] + } + ] + } +] diff --git a/test/integration/fixtures/blocks/core__form.parsed.json b/test/integration/fixtures/blocks/core__form.parsed.json new file mode 100644 index 0000000000000..1cb360568ad8f --- /dev/null +++ b/test/integration/fixtures/blocks/core__form.parsed.json @@ -0,0 +1,88 @@ +[ + { + "blockName": "core/form", + "attrs": { + "formId": "the-form-id" + }, + "innerBlocks": [ + { + "blockName": "core/input-field", + "attrs": { + "label": "Name - required, inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "checkbox", + "label": "Checkbox - inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "email", + "label": "Email - required", + "required": true + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "textarea", + "label": "Textarea input" + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "submit", + "label": "Submit" + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + } + ], + "innerHTML": "\n
\n\n\n\n\n\n\n\n
\n", + "innerContent": [ + "\n
", + null, + "\n\n", + null, + "\n\n", + null, + "\n\n", + null, + "\n\n", + null, + "
\n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__form.serialized.html b/test/integration/fixtures/blocks/core__form.serialized.html new file mode 100644 index 0000000000000..9015fe38dd19c --- /dev/null +++ b/test/integration/fixtures/blocks/core__form.serialized.html @@ -0,0 +1,21 @@ + +
+ + + + + + + + + + + + + + + + +
+
+ diff --git a/test/integration/fixtures/blocks/core__input-field.html b/test/integration/fixtures/blocks/core__input-field.html new file mode 100644 index 0000000000000..2574bc62f5c7c --- /dev/null +++ b/test/integration/fixtures/blocks/core__input-field.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + +
+ diff --git a/test/integration/fixtures/blocks/core__input-field.json b/test/integration/fixtures/blocks/core__input-field.json new file mode 100644 index 0000000000000..488701c5558f7 --- /dev/null +++ b/test/integration/fixtures/blocks/core__input-field.json @@ -0,0 +1,57 @@ +[ + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "text", + "label": "Name - required, inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "checkbox", + "label": "Checkbox - inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "email", + "label": "Email - required", + "inlineLabel": false, + "required": true + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "textarea", + "label": "Textarea input", + "inlineLabel": false, + "required": false + }, + "innerBlocks": [] + }, + { + "name": "core/input-field", + "isValid": true, + "attributes": { + "type": "submit", + "label": "Submit", + "inlineLabel": false, + "required": false + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__input-field.parsed.json b/test/integration/fixtures/blocks/core__input-field.parsed.json new file mode 100644 index 0000000000000..886e3e6d35ad8 --- /dev/null +++ b/test/integration/fixtures/blocks/core__input-field.parsed.json @@ -0,0 +1,94 @@ +[ + { + "blockName": "core/input-field", + "attrs": { + "label": "Name - required, inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "checkbox", + "label": "Checkbox - inline label", + "inlineLabel": true, + "required": true + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "email", + "label": "Email - required", + "required": true + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "textarea", + "label": "Textarea input" + }, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] + }, + { + "blockName": "core/input-field", + "attrs": { + "type": "submit", + "label": "Submit" + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__input-field.serialized.html b/test/integration/fixtures/blocks/core__input-field.serialized.html new file mode 100644 index 0000000000000..2574bc62f5c7c --- /dev/null +++ b/test/integration/fixtures/blocks/core__input-field.serialized.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + +
+