Skip to content

Commit

Permalink
Add base fixtures for checkbox, radio, and textarea inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Aug 28, 2024
1 parent 8cc11de commit c222f88
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:form-input {"type":"checkbox","inlineLabel":true} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label is-label-inline"><input class="wp-block-form-input__input" type="checkbox" name="label" required aria-required="true"/><span class="wp-block-form-input__label-content">Label</span></label></div>
<!-- /wp:form-input -->
15 changes: 15 additions & 0 deletions test/integration/fixtures/blocks/core__form-input__checkbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"name": "core/form-input",
"isValid": true,
"attributes": {
"type": "checkbox",
"label": "Label",
"inlineLabel": true,
"required": true,
"value": "",
"visibilityPermissions": "all"
},
"innerBlocks": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"blockName": "core/form-input",
"attrs": {
"type": "checkbox",
"inlineLabel": true
},
"innerBlocks": [],
"innerHTML": "\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label is-label-inline\"><input class=\"wp-block-form-input__input\" type=\"checkbox\" name=\"label\" required aria-required=\"true\"/><span class=\"wp-block-form-input__label-content\">Label</span></label></div>\n",
"innerContent": [
"\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label is-label-inline\"><input class=\"wp-block-form-input__input\" type=\"checkbox\" name=\"label\" required aria-required=\"true\"/><span class=\"wp-block-form-input__label-content\">Label</span></label></div>\n"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:form-input {"type":"checkbox","inlineLabel":true} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label is-label-inline"><input class="wp-block-form-input__input" type="checkbox" name="label" required aria-required="true"/><span class="wp-block-form-input__label-content">Label</span></label></div>
<!-- /wp:form-input -->
3 changes: 3 additions & 0 deletions test/integration/fixtures/blocks/core__form-input__radio.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:form-input {"type":"radio","inlineLabel":true} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label is-label-inline"><input class="wp-block-form-input__input" type="radio" name="label" required aria-required="true"/><span class="wp-block-form-input__label-content">Label</span></label></div>
<!-- /wp:form-input -->
15 changes: 15 additions & 0 deletions test/integration/fixtures/blocks/core__form-input__radio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"name": "core/form-input",
"isValid": true,
"attributes": {
"type": "radio",
"label": "Label",
"inlineLabel": true,
"required": true,
"value": "",
"visibilityPermissions": "all"
},
"innerBlocks": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"blockName": "core/form-input",
"attrs": {
"type": "radio",
"inlineLabel": true
},
"innerBlocks": [],
"innerHTML": "\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label is-label-inline\"><input class=\"wp-block-form-input__input\" type=\"radio\" name=\"label\" required aria-required=\"true\"/><span class=\"wp-block-form-input__label-content\">Label</span></label></div>\n",
"innerContent": [
"\n<div class=\"wp-block-form-input\"><label class=\"wp-block-form-input__label is-label-inline\"><input class=\"wp-block-form-input__input\" type=\"radio\" name=\"label\" required aria-required=\"true\"/><span class=\"wp-block-form-input__label-content\">Label</span></label></div>\n"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:form-input {"type":"radio","inlineLabel":true} -->
<div class="wp-block-form-input"><label class="wp-block-form-input__label is-label-inline"><input class="wp-block-form-input__input" type="radio" name="label" required aria-required="true"/><span class="wp-block-form-input__label-content">Label</span></label></div>
<!-- /wp:form-input -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- 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">Label</span><textarea class="wp-block-form-input__input" name="label" required aria-required="true"></textarea></label></div>
<!-- /wp:form-input -->
15 changes: 15 additions & 0 deletions test/integration/fixtures/blocks/core__form-input__textarea.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"name": "core/form-input",
"isValid": true,
"attributes": {
"type": "textarea",
"label": "Label",
"inlineLabel": false,
"required": true,
"value": "",
"visibilityPermissions": "all"
},
"innerBlocks": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"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\">Label</span><textarea class=\"wp-block-form-input__input\" name=\"label\" 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\">Label</span><textarea class=\"wp-block-form-input__input\" name=\"label\" required aria-required=\"true\"></textarea></label></div>\n"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- 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">Label</span><textarea class="wp-block-form-input__input" name="label" required aria-required="true"></textarea></label></div>
<!-- /wp:form-input -->

0 comments on commit c222f88

Please sign in to comment.