Skip to content

Commit

Permalink
add fixture for deprecated version of block
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Apr 19, 2024
1 parent 3f4f6cc commit 69bcc8a
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/integration/fixtures/blocks/core__form__deprecated-v1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- wp:form {"style":{"color":{"text":"#913636","background":"#d1c6c6"},"elements":{"link":{"color":{"text":"#913636"}}},"typography":{"fontSize":"18px"}}} -->
<form class="wp-block-form" style="color:#913636;background-color:#d1c6c6;font-size:18px" enctype="text/plain"><!-- wp:form-input -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label"><span class="wp-block-form-input__label-content">Name</span><input class="wp-block-form-input__input" type="text" name="name" required aria-required="true"/></label></div>
<!-- /wp:form-input -->

<!-- wp:form-input {"type":"email"} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label"><span class="wp-block-form-input__label-content">Email</span><input class="wp-block-form-input__input" type="email" name="email" required aria-required="true"/></label></div>
<!-- /wp:form-input -->

<!-- wp:form-input {"type":"textarea"} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label"><span class="wp-block-form-input__label-content">Comment</span><textarea class="wp-block-form-input__input" name="comment" required aria-required="true"></textarea></label></div>
<!-- /wp:form-input -->

<!-- wp:form-submit-button -->
<div class="wp-block-form-submit-button"><!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button {"tagName":"button","type":"submit"} -->
<div class="wp-block-button"><button type="submit" class="wp-block-button__link wp-element-button">Submit</button></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:form-submit-button --></form>
<!-- /wp:form -->
91 changes: 91 additions & 0 deletions test/integration/fixtures/blocks/core__form__deprecated-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[
{
"name": "core/form",
"isValid": false,
"attributes": {
"submissionMethod": "email",
"method": "post",
"style": {
"color": {
"text": "#913636",
"background": "#d1c6c6"
},
"elements": {
"link": {
"color": {
"text": "#913636"
}
}
},
"typography": {
"fontSize": "18px"
}
}
},
"innerBlocks": [
{
"name": "core/form-input",
"isValid": true,
"attributes": {
"type": "text",
"label": "Name",
"inlineLabel": false,
"required": true,
"value": "",
"visibilityPermissions": "all"
},
"innerBlocks": []
},
{
"name": "core/form-input",
"isValid": true,
"attributes": {
"type": "email",
"label": "Email",
"inlineLabel": false,
"required": true,
"value": "",
"visibilityPermissions": "all"
},
"innerBlocks": []
},
{
"name": "core/form-input",
"isValid": true,
"attributes": {
"type": "textarea",
"label": "Comment",
"inlineLabel": false,
"required": true,
"value": "",
"visibilityPermissions": "all"
},
"innerBlocks": []
},
{
"name": "core/form-submit-button",
"isValid": true,
"attributes": {},
"innerBlocks": [
{
"name": "core/buttons",
"isValid": true,
"attributes": {},
"innerBlocks": [
{
"name": "core/button",
"isValid": true,
"attributes": {
"tagName": "button",
"type": "submit",
"text": "Submit"
},
"innerBlocks": []
}
]
}
]
}
]
}
]
104 changes: 104 additions & 0 deletions test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[
{
"blockName": "core/form",
"attrs": {
"style": {
"color": {
"text": "#913636",
"background": "#d1c6c6"
},
"elements": {
"link": {
"color": {
"text": "#913636"
}
}
},
"typography": {
"fontSize": "18px"
}
}
},
"innerBlocks": [
{
"blockName": "core/form-input",
"attrs": {},
"innerBlocks": [],
"innerHTML": "\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label\"><span class=\"wp-block-form-input__label-content\">Name</span><input class=\"wp-block-form-input__input\" type=\"text\" name=\"name\" required aria-required=\"true\"/></label></div>\n",
"innerContent": [
"\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label\"><span class=\"wp-block-form-input__label-content\">Name</span><input class=\"wp-block-form-input__input\" type=\"text\" name=\"name\" required aria-required=\"true\"/></label></div>\n"
]
},
{
"blockName": "core/form-input",
"attrs": {
"type": "email"
},
"innerBlocks": [],
"innerHTML": "\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label\"><span class=\"wp-block-form-input__label-content\">Email</span><input class=\"wp-block-form-input__input\" type=\"email\" name=\"email\" required aria-required=\"true\"/></label></div>\n",
"innerContent": [
"\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label\"><span class=\"wp-block-form-input__label-content\">Email</span><input class=\"wp-block-form-input__input\" type=\"email\" name=\"email\" required aria-required=\"true\"/></label></div>\n"
]
},
{
"blockName": "core/form-input",
"attrs": {
"type": "textarea"
},
"innerBlocks": [],
"innerHTML": "\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label\"><span class=\"wp-block-form-input__label-content\">Comment</span><textarea class=\"wp-block-form-input__input\" name=\"comment\" required aria-required=\"true\"></textarea></label></div>\n",
"innerContent": [
"\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label\"><span class=\"wp-block-form-input__label-content\">Comment</span><textarea class=\"wp-block-form-input__input\" name=\"comment\" required aria-required=\"true\"></textarea></label></div>\n"
]
},
{
"blockName": "core/form-submit-button",
"attrs": {},
"innerBlocks": [
{
"blockName": "core/buttons",
"attrs": {},
"innerBlocks": [
{
"blockName": "core/button",
"attrs": {
"tagName": "button",
"type": "submit"
},
"innerBlocks": [],
"innerHTML": "\n<div class=\"wp-block-button\"><button type=\"submit\" class=\"wp-block-button__link wp-element-button\">Submit</button></div>\n",
"innerContent": [
"\n<div class=\"wp-block-button\"><button type=\"submit\" class=\"wp-block-button__link wp-element-button\">Submit</button></div>\n"
]
}
],
"innerHTML": "\n<div class=\"wp-block-buttons\"></div>\n",
"innerContent": [
"\n<div class=\"wp-block-buttons\">",
null,
"</div>\n"
]
}
],
"innerHTML": "\n<div class=\"wp-block-form-submit-button\"></div>\n",
"innerContent": [
"\n<div class=\"wp-block-form-submit-button\">",
null,
"</div>\n"
]
}
],
"innerHTML": "\n<form class=\"wp-block-form\" style=\"color:#913636;background-color:#d1c6c6;font-size:18px\" enctype=\"text/plain\">\n\n\n\n\n\n</form>\n",
"innerContent": [
"\n<form class=\"wp-block-form\" style=\"color:#913636;background-color:#d1c6c6;font-size:18px\" enctype=\"text/plain\">",
null,
"\n\n",
null,
"\n\n",
null,
"\n\n",
null,
"</form>\n"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- wp:form {"style":{"color":{"text":"#913636","background":"#d1c6c6"},"elements":{"link":{"color":{"text":"#913636"}}},"typography":{"fontSize":"18px"}}} -->
<form class="wp-block-form" style="color:#913636;background-color:#d1c6c6;font-size:18px" enctype="text/plain">
<!-- wp:form-input -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label"><span class="wp-block-form-input__label-content">Name</span><input class="wp-block-form-input__input" type="text" name="name" required aria-required="true"/></label></div>
<!-- /wp:form-input -->
<!-- wp:form-input {"type":"email"} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label"><span class="wp-block-form-input__label-content">Email</span><input class="wp-block-form-input__input" type="email" name="email" required aria-required="true"/></label></div>
<!-- /wp:form-input -->
<!-- wp:form-input {"type":"textarea"} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label"><span class="wp-block-form-input__label-content">Comment</span><textarea class="wp-block-form-input__input" name="comment" required aria-required="true"></textarea></label></div>
<!-- /wp:form-input -->
<!-- wp:form-submit-button -->
<div class="wp-block-form-submit-button">
<!-- wp:buttons -->
<div class="wp-block-buttons">
<!-- wp:button {"tagName":"button","type":"submit"} -->
<div class="wp-block-button"><button type="submit" class="wp-block-button__link wp-element-button">Submit</button></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:form-submit-button -->
</form>
<!-- /wp:form -->

0 comments on commit 69bcc8a

Please sign in to comment.