Skip to content

Commit

Permalink
fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Oct 19, 2022
1 parent 1d55a97 commit fceea3d
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 242 deletions.
18 changes: 9 additions & 9 deletions test/integration/fixtures/blocks/core__form.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!-- wp:form {"formId":"the-form-id"} -->
<form class="wp-block-form"><!-- wp:input-field {"label":"Name - required, inline label","inlineLabel":true,"required":true} -->
<label class="wp-block-input-field-label is-label-inline"><div class="wp-block-input-field-label__content">Name - required, inline label</div><input class="wp-block-input-field" type="text" name="Name - required, inline label" required aria-required="true"/></label>
<!-- wp:form -->
<form><!-- wp:input-field {"label":"Name","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Name</div><input class="wp-block-input-field" type="text" name="Name" required aria-required="true"/></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"checkbox","label":"Checkbox - inline label","inlineLabel":true,"required":true} -->
<label class="wp-block-input-field-label is-label-inline"><div class="wp-block-input-field-label__content">Checkbox - inline label</div><input class="wp-block-input-field" type="checkbox" name="Checkbox - inline label" required aria-required="true"/></label>
<!-- wp:input-field {"type":"email","label":"Email","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Email</div><input class="wp-block-input-field" type="email" name="Email" required aria-required="true"/></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"email","label":"Email - required","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Email - required</div><input class="wp-block-input-field" type="email" name="Email - required" required aria-required="true"/></label>
<!-- wp:input-field {"type":"url","label":"Website"} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Website</div><input class="wp-block-input-field" type="url" name="Website" aria-required="false"/></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"textarea","label":"Textarea input"} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Textarea input</div><textarea class="wp-block-input-field" name="Textarea input" aria-required="false"></textarea></label>
<!-- wp:input-field {"type":"textarea","label":"Comment","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Comment</div><textarea class="wp-block-input-field" name="Comment" required aria-required="true"></textarea></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"submit","label":"Submit"} -->
Expand Down
53 changes: 24 additions & 29 deletions test/integration/fixtures/blocks/core__form.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,60 @@
[
{
"name": "core/form",
"name": "core/missing",
"isValid": true,
"attributes": {
"action": "#",
"method": "post",
"formId": "the-form-id"
"originalName": "core/form",
"originalUndelimitedContent": "<form>\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Name</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name\" required aria-required=\"true\"/></label>\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email\" required aria-required=\"true\"/></label>\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Website</div><input class=\"wp-block-input-field\" type=\"url\" name=\"Website\" aria-required=\"false\"/></label>\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Comment</div><textarea class=\"wp-block-input-field\" name=\"Comment\" required aria-required=\"true\"></textarea></label>\n<div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><button class=\"wp-block-button__link wp-element-button\">Submit</button></div></div>\n</form>",
"originalContent": "<!-- wp:form -->\n<form>\n<!-- wp:input-field {\"label\":\"Name\",\"required\":true} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Name</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name\" required=\"\" aria-required=\"true\"></label>\n<!-- /wp:input-field -->\n<!-- wp:input-field {\"type\":\"email\",\"label\":\"Email\",\"required\":true} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email\" required=\"\" aria-required=\"true\"></label>\n<!-- /wp:input-field -->\n<!-- wp:input-field {\"type\":\"url\",\"label\":\"Website\"} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Website</div><input class=\"wp-block-input-field\" type=\"url\" name=\"Website\" aria-required=\"false\"></label>\n<!-- /wp:input-field -->\n<!-- wp:input-field {\"type\":\"textarea\",\"label\":\"Comment\",\"required\":true} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Comment</div><textarea class=\"wp-block-input-field\" name=\"Comment\" required=\"\" aria-required=\"true\"></textarea></label>\n<!-- /wp:input-field -->\n<!-- wp:input-field {\"type\":\"submit\",\"label\":\"Submit\"} -->\n<div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><button class=\"wp-block-button__link wp-element-button\">Submit</button></div></div>\n<!-- /wp:input-field -->\n</form>\n<!-- /wp:form -->"
},
"innerBlocks": [
{
"name": "core/input-field",
"name": "core/missing",
"isValid": true,
"attributes": {
"type": "text",
"label": "Name - required, inline label",
"inlineLabel": true,
"required": true
"originalName": "core/input-field",
"originalUndelimitedContent": "<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Name</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name\" required aria-required=\"true\"/></label>",
"originalContent": "<!-- wp:input-field {\"label\":\"Name\",\"required\":true} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Name</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name\" required=\"\" aria-required=\"true\"></label>\n<!-- /wp:input-field -->"
},
"innerBlocks": []
},
{
"name": "core/input-field",
"name": "core/missing",
"isValid": true,
"attributes": {
"type": "checkbox",
"label": "Checkbox - inline label",
"inlineLabel": true,
"required": true
"originalName": "core/input-field",
"originalUndelimitedContent": "<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email\" required aria-required=\"true\"/></label>",
"originalContent": "<!-- wp:input-field {\"type\":\"email\",\"label\":\"Email\",\"required\":true} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email\" required=\"\" aria-required=\"true\"></label>\n<!-- /wp:input-field -->"
},
"innerBlocks": []
},
{
"name": "core/input-field",
"name": "core/missing",
"isValid": true,
"attributes": {
"type": "email",
"label": "Email - required",
"inlineLabel": false,
"required": true
"originalName": "core/input-field",
"originalUndelimitedContent": "<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Website</div><input class=\"wp-block-input-field\" type=\"url\" name=\"Website\" aria-required=\"false\"/></label>",
"originalContent": "<!-- wp:input-field {\"type\":\"url\",\"label\":\"Website\"} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Website</div><input class=\"wp-block-input-field\" type=\"url\" name=\"Website\" aria-required=\"false\"></label>\n<!-- /wp:input-field -->"
},
"innerBlocks": []
},
{
"name": "core/input-field",
"name": "core/missing",
"isValid": true,
"attributes": {
"type": "textarea",
"label": "Textarea input",
"inlineLabel": false,
"required": false
"originalName": "core/input-field",
"originalUndelimitedContent": "<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Comment</div><textarea class=\"wp-block-input-field\" name=\"Comment\" required aria-required=\"true\"></textarea></label>",
"originalContent": "<!-- wp:input-field {\"type\":\"textarea\",\"label\":\"Comment\",\"required\":true} -->\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Comment</div><textarea class=\"wp-block-input-field\" name=\"Comment\" required=\"\" aria-required=\"true\"></textarea></label>\n<!-- /wp:input-field -->"
},
"innerBlocks": []
},
{
"name": "core/input-field",
"name": "core/missing",
"isValid": true,
"attributes": {
"type": "submit",
"label": "Submit",
"inlineLabel": false,
"required": false
"originalName": "core/input-field",
"originalUndelimitedContent": "<div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><button class=\"wp-block-button__link wp-element-button\">Submit</button></div></div>",
"originalContent": "<!-- wp:input-field {\"type\":\"submit\",\"label\":\"Submit\"} -->\n<div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><button class=\"wp-block-button__link wp-element-button\">Submit</button></div></div>\n<!-- /wp:input-field -->"
},
"innerBlocks": []
}
Expand Down
40 changes: 18 additions & 22 deletions test/integration/fixtures/blocks/core__form.parsed.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
[
{
"blockName": "core/form",
"attrs": {
"formId": "the-form-id"
},
"attrs": {},
"innerBlocks": [
{
"blockName": "core/input-field",
"attrs": {
"label": "Name - required, inline label",
"inlineLabel": true,
"label": "Name",
"required": true
},
"innerBlocks": [],
"innerHTML": "\n<label class=\"wp-block-input-field-label is-label-inline\"><div class=\"wp-block-input-field-label__content\">Name - required, inline label</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name - required, inline label\" required aria-required=\"true\"/></label>\n",
"innerHTML": "\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Name</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name\" required aria-required=\"true\"/></label>\n",
"innerContent": [
"\n<label class=\"wp-block-input-field-label is-label-inline\"><div class=\"wp-block-input-field-label__content\">Name - required, inline label</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name - required, inline label\" required aria-required=\"true\"/></label>\n"
"\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Name</div><input class=\"wp-block-input-field\" type=\"text\" name=\"Name\" required aria-required=\"true\"/></label>\n"
]
},
{
"blockName": "core/input-field",
"attrs": {
"type": "checkbox",
"label": "Checkbox - inline label",
"inlineLabel": true,
"type": "email",
"label": "Email",
"required": true
},
"innerBlocks": [],
"innerHTML": "\n<label class=\"wp-block-input-field-label is-label-inline\"><div class=\"wp-block-input-field-label__content\">Checkbox - inline label</div><input class=\"wp-block-input-field\" type=\"checkbox\" name=\"Checkbox - inline label\" required aria-required=\"true\"/></label>\n",
"innerHTML": "\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email\" required aria-required=\"true\"/></label>\n",
"innerContent": [
"\n<label class=\"wp-block-input-field-label is-label-inline\"><div class=\"wp-block-input-field-label__content\">Checkbox - inline label</div><input class=\"wp-block-input-field\" type=\"checkbox\" name=\"Checkbox - inline label\" required aria-required=\"true\"/></label>\n"
"\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email\" required aria-required=\"true\"/></label>\n"
]
},
{
"blockName": "core/input-field",
"attrs": {
"type": "email",
"label": "Email - required",
"required": true
"type": "url",
"label": "Website"
},
"innerBlocks": [],
"innerHTML": "\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email - required</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email - required\" required aria-required=\"true\"/></label>\n",
"innerHTML": "\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Website</div><input class=\"wp-block-input-field\" type=\"url\" name=\"Website\" aria-required=\"false\"/></label>\n",
"innerContent": [
"\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Email - required</div><input class=\"wp-block-input-field\" type=\"email\" name=\"Email - required\" required aria-required=\"true\"/></label>\n"
"\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Website</div><input class=\"wp-block-input-field\" type=\"url\" name=\"Website\" aria-required=\"false\"/></label>\n"
]
},
{
"blockName": "core/input-field",
"attrs": {
"type": "textarea",
"label": "Textarea input"
"label": "Comment",
"required": true
},
"innerBlocks": [],
"innerHTML": "\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Textarea input</div><textarea class=\"wp-block-input-field\" name=\"Textarea input\" aria-required=\"false\"></textarea></label>\n",
"innerHTML": "\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Comment</div><textarea class=\"wp-block-input-field\" name=\"Comment\" required aria-required=\"true\"></textarea></label>\n",
"innerContent": [
"\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Textarea input</div><textarea class=\"wp-block-input-field\" name=\"Textarea input\" aria-required=\"false\"></textarea></label>\n"
"\n<label class=\"wp-block-input-field-label\"><div class=\"wp-block-input-field-label__content\">Comment</div><textarea class=\"wp-block-input-field\" name=\"Comment\" required aria-required=\"true\"></textarea></label>\n"
]
},
{
Expand All @@ -70,9 +66,9 @@
]
}
],
"innerHTML": "\n<form class=\"wp-block-form\">\n\n\n\n\n\n\n\n</form>\n",
"innerHTML": "\n<form>\n\n\n\n\n\n\n\n</form>\n",
"innerContent": [
"\n<form class=\"wp-block-form\">",
"\n<form>",
null,
"\n\n",
null,
Expand Down
26 changes: 12 additions & 14 deletions test/integration/fixtures/blocks/core__form.serialized.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<!-- wp:form {"formId":"the-form-id"} -->
<form class="wp-block-form"><!-- wp:input-field {"label":"Name - required, inline label","inlineLabel":true,"required":true} -->
<label class="wp-block-input-field-label is-label-inline"><div class="wp-block-input-field-label__content">Name - required, inline label</div><input class="wp-block-input-field" type="text" name="Name - required, inline label" required aria-required="true"/></label>
<!-- wp:form -->
<form>
<!-- wp:input-field {"label":"Name","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Name</div><input class="wp-block-input-field" type="text" name="Name" required="" aria-required="true"></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"checkbox","label":"Checkbox - inline label","inlineLabel":true,"required":true} -->
<label class="wp-block-input-field-label is-label-inline"><div class="wp-block-input-field-label__content">Checkbox - inline label</div><input class="wp-block-input-field" type="checkbox" name="Checkbox - inline label" required aria-required="true"/></label>
<!-- wp:input-field {"type":"email","label":"Email","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Email</div><input class="wp-block-input-field" type="email" name="Email" required="" aria-required="true"></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"email","label":"Email - required","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Email - required</div><input class="wp-block-input-field" type="email" name="Email - required" required aria-required="true"/></label>
<!-- wp:input-field {"type":"url","label":"Website"} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Website</div><input class="wp-block-input-field" type="url" name="Website" aria-required="false"></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"textarea","label":"Textarea input"} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Textarea input</div><textarea class="wp-block-input-field" name="Textarea input" aria-required="false"></textarea></label>
<!-- wp:input-field {"type":"textarea","label":"Comment","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Comment</div><textarea class="wp-block-input-field" name="Comment" required="" aria-required="true"></textarea></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"submit","label":"Submit"} -->
<div class="wp-block-buttons"><div class="wp-block-button"><button class="wp-block-button__link wp-element-button">Submit</button></div></div>
<!-- /wp:input-field --></form>
<!-- /wp:input-field -->
</form>
<!-- /wp:form -->
20 changes: 2 additions & 18 deletions test/integration/fixtures/blocks/core__input-field.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
<!-- wp:input-field {"label":"Name - required, inline label","inlineLabel":true,"required":true} -->
<label class="wp-block-input-field-label is-label-inline"><div class="wp-block-input-field-label__content">Name - required, inline label</div><input class="wp-block-input-field" type="text" name="Name - required, inline label" required aria-required="true"/></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"checkbox","label":"Checkbox - inline label","inlineLabel":true,"required":true} -->
<label class="wp-block-input-field-label is-label-inline"><div class="wp-block-input-field-label__content">Checkbox - inline label</div><input class="wp-block-input-field" type="checkbox" name="Checkbox - inline label" required aria-required="true"/></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"email","label":"Email - required","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Email - required</div><input class="wp-block-input-field" type="email" name="Email - required" required aria-required="true"/></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"textarea","label":"Textarea input"} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Textarea input</div><textarea class="wp-block-input-field" name="Textarea input" aria-required="false"></textarea></label>
<!-- /wp:input-field -->

<!-- wp:input-field {"type":"submit","label":"Submit"} -->
<div class="wp-block-buttons"><div class="wp-block-button"><button class="wp-block-button__link wp-element-button">Submit</button></div></div>
<!-- wp:input-field {"label":"Name","required":true} -->
<label class="wp-block-input-field-label"><div class="wp-block-input-field-label__content">Name</div><input class="wp-block-input-field" type="text" name="Name" required aria-required="true"/></label>
<!-- /wp:input-field -->
Loading

0 comments on commit fceea3d

Please sign in to comment.