mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Update Gallery block unit tests to new gallery format
The Gallery block unit tests still use the old format, so this updates it to the new format that uses nested Image blocks. Props glendaviesnz. Fixes #55571. git-svn-id: https://develop.svn.wordpress.org/trunk@53261 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0cb3193616
commit
3cc94be23b
@ -1,14 +1,15 @@
|
||||
<!-- wp:core/gallery -->
|
||||
<ul class="wp-block-gallery columns-2 is-cropped">
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="http://google.com/hi.png" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- /wp:core/gallery -->
|
||||
<!-- wp:gallery {"linkTo":"none","className":"columns-2"} -->
|
||||
<figure class="wp-block-gallery has-nested-images columns-default is-cropped columns-2">
|
||||
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
|
||||
</figure>
|
||||
<!-- /wp:image -->
|
||||
|
||||
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="http://google.com/hi.png" alt="Image gallery image" />
|
||||
</figure>
|
||||
<!-- /wp:image -->
|
||||
</figure>
|
||||
<!-- /wp:gallery -->
|
||||
|
||||
@ -1,25 +1,44 @@
|
||||
[
|
||||
{
|
||||
"clientId": "_clientId_0",
|
||||
"name": "core/gallery",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"images": [
|
||||
{
|
||||
"url": "https://cldup.com/uuUqE_dXzy.jpg",
|
||||
"alt": "title",
|
||||
"caption": ""
|
||||
},
|
||||
{
|
||||
"url": "http://google.com/hi.png",
|
||||
"alt": "title",
|
||||
"caption": ""
|
||||
}
|
||||
],
|
||||
"imageCrop": true,
|
||||
"linkTo": "none"
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"originalContent": "<ul class=\"wp-block-gallery columns-2 is-cropped\">\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"http://google.com/hi.png\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n</ul>"
|
||||
}
|
||||
{
|
||||
"name": "core/gallery",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"images": [],
|
||||
"ids": [],
|
||||
"shortCodeTransforms": [],
|
||||
"caption": "",
|
||||
"imageCrop": true,
|
||||
"fixedHeight": true,
|
||||
"linkTo": "none",
|
||||
"sizeSlug": "large",
|
||||
"allowResize": false,
|
||||
"className": "columns-2"
|
||||
},
|
||||
"innerBlocks": [
|
||||
{
|
||||
"name": "core/image",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"url": "https://cldup.com/uuUqE_dXzy.jpg",
|
||||
"alt": "Image gallery image",
|
||||
"caption": "",
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": []
|
||||
},
|
||||
{
|
||||
"name": "core/image",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"url": "http://google.com/hi.png",
|
||||
"alt": "Image gallery image",
|
||||
"caption": "",
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,13 +1,45 @@
|
||||
[
|
||||
{
|
||||
"blockName": "core/gallery",
|
||||
"attrs": {},
|
||||
"innerBlocks": [],
|
||||
"innerHTML": "\n<ul class=\"wp-block-gallery columns-2 is-cropped\">\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"http://google.com/hi.png\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n</ul>\n",
|
||||
"innerContent": [
|
||||
"\n<ul class=\"wp-block-gallery columns-2 is-cropped\">\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"http://google.com/hi.png\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n</ul>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockName": "core/gallery",
|
||||
"attrs": {
|
||||
"linkTo": "none",
|
||||
"className": "columns-2"
|
||||
},
|
||||
"innerBlocks": [
|
||||
{
|
||||
"blockName": "core/image",
|
||||
"attrs": {
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"innerHTML": "\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"Image gallery image\" />\n\t</figure>\n\t",
|
||||
"innerContent": [
|
||||
"\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"Image gallery image\" />\n\t</figure>\n\t"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockName": "core/image",
|
||||
"attrs": {
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"innerHTML": "\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"http://google.com/hi.png\" alt=\"Image gallery image\" />\n\t</figure>\n\t",
|
||||
"innerContent": [
|
||||
"\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"http://google.com/hi.png\" alt=\"Image gallery image\" />\n\t</figure>\n\t"
|
||||
]
|
||||
}
|
||||
],
|
||||
"innerHTML": "\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped columns-2\">\n\t\n\n\t\n</figure>\n",
|
||||
"innerContent": [
|
||||
"\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped columns-2\">\n\t",
|
||||
null,
|
||||
"\n\n\t",
|
||||
null,
|
||||
"\n</figure>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockName": null,
|
||||
"attrs": {},
|
||||
@ -17,4 +49,4 @@
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
@ -1,3 +1,3 @@
|
||||
<!-- wp:gallery -->
|
||||
<ul class="wp-block-gallery columns-2 is-cropped"><li class="blocks-gallery-item"><figure><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title"/></figure></li><li class="blocks-gallery-item"><figure><img src="http://google.com/hi.png" alt="title"/></figure></li></ul>
|
||||
<!-- /wp:gallery -->
|
||||
<!-- wp:gallery {"linkTo":"none","className":"columns-2"} -->
|
||||
<figure class="wp-block-gallery has-nested-images columns-default is-cropped columns-2"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} --><figure class="wp-block-image size-large"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" /></figure><!-- /wp:image --><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} --><figure class="wp-block-image size-large"><img src="http://google.com/hi.png" alt="Image gallery image" /></figure><!-- /wp:image --></figure>
|
||||
<!-- /wp:gallery -->
|
||||
@ -1,14 +1,15 @@
|
||||
|
||||
<ul class="wp-container-1 wp-block-gallery-1 wp-block-gallery columns-2 is-cropped">
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="http://google.com/hi.png" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
</ul>
|
||||
<figure class="wp-container-1 wp-block-gallery-1 wp-block-gallery has-nested-images columns-default is-cropped columns-2">
|
||||
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
|
||||
</figure>
|
||||
|
||||
|
||||
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="http://google.com/hi.png" alt="Image gallery image" />
|
||||
</figure>
|
||||
|
||||
</figure>
|
||||
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
<!-- wp:core/gallery {"columns":1} -->
|
||||
<ul class="wp-block-gallery columns-1 is-cropped">
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="http://google.com/hi.png" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- /wp:core/gallery -->
|
||||
<!-- wp:gallery {"linkTo":"none","className":"columns-1"} -->
|
||||
<figure class="wp-block-gallery has-nested-images is-cropped columns-1" >
|
||||
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
|
||||
</figure>
|
||||
<!-- /wp:image -->
|
||||
|
||||
<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="http://google.com/hi.png" alt="Image gallery image" />
|
||||
</figure>
|
||||
<!-- /wp:image -->
|
||||
</figure>
|
||||
<!-- /wp:gallery -->
|
||||
|
||||
@ -1,26 +1,45 @@
|
||||
[
|
||||
{
|
||||
"clientId": "_clientId_0",
|
||||
"name": "core/gallery",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"images": [
|
||||
{
|
||||
"url": "https://cldup.com/uuUqE_dXzy.jpg",
|
||||
"alt": "title",
|
||||
"caption": ""
|
||||
},
|
||||
{
|
||||
"url": "http://google.com/hi.png",
|
||||
"alt": "title",
|
||||
"caption": ""
|
||||
}
|
||||
],
|
||||
"columns": 1,
|
||||
"imageCrop": true,
|
||||
"linkTo": "none"
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"originalContent": "<ul class=\"wp-block-gallery columns-1 is-cropped\">\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"http://google.com/hi.png\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n</ul>"
|
||||
}
|
||||
{
|
||||
"name": "core/gallery",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"images": [],
|
||||
"ids": [],
|
||||
"shortCodeTransforms": [],
|
||||
"caption": "",
|
||||
"imageCrop": true,
|
||||
"fixedHeight": true,
|
||||
"linkTo": "none",
|
||||
"sizeSlug": "large",
|
||||
"allowResize": false,
|
||||
"className": "columns-1",
|
||||
"columns": 1
|
||||
},
|
||||
"innerBlocks": [
|
||||
{
|
||||
"name": "core/image",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"url": "https://cldup.com/uuUqE_dXzy.jpg",
|
||||
"alt": "Image gallery image",
|
||||
"caption": "",
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": []
|
||||
},
|
||||
{
|
||||
"name": "core/image",
|
||||
"isValid": true,
|
||||
"attributes": {
|
||||
"url": "http://google.com/hi.png",
|
||||
"alt": "Image gallery image",
|
||||
"caption": "",
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,15 +1,45 @@
|
||||
[
|
||||
{
|
||||
"blockName": "core/gallery",
|
||||
"attrs": {
|
||||
"columns": 1
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"innerHTML": "\n<ul class=\"wp-block-gallery columns-1 is-cropped\">\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"http://google.com/hi.png\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n</ul>\n",
|
||||
"innerContent": [
|
||||
"\n<ul class=\"wp-block-gallery columns-1 is-cropped\">\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n\t<li class=\"blocks-gallery-item\">\n\t\t<figure>\n\t\t\t<img src=\"http://google.com/hi.png\" alt=\"title\" />\n\t\t</figure>\n\t</li>\n</ul>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockName": "core/gallery",
|
||||
"attrs": {
|
||||
"linkTo": "none",
|
||||
"className": "columns-1"
|
||||
},
|
||||
"innerBlocks": [
|
||||
{
|
||||
"blockName": "core/image",
|
||||
"attrs": {
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"innerHTML": "\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"Image gallery image\" />\n\t</figure>\n\t",
|
||||
"innerContent": [
|
||||
"\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"https://cldup.com/uuUqE_dXzy.jpg\" alt=\"Image gallery image\" />\n\t</figure>\n\t"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockName": "core/image",
|
||||
"attrs": {
|
||||
"sizeSlug": "large",
|
||||
"linkDestination": "none"
|
||||
},
|
||||
"innerBlocks": [],
|
||||
"innerHTML": "\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"http://google.com/hi.png\" alt=\"Image gallery image\" />\n\t</figure>\n\t",
|
||||
"innerContent": [
|
||||
"\n\t<figure class=\"wp-block-image size-large\">\n\t\t<img src=\"http://google.com/hi.png\" alt=\"Image gallery image\" />\n\t</figure>\n\t"
|
||||
]
|
||||
}
|
||||
],
|
||||
"innerHTML": "\n<figure class=\"wp-block-gallery has-nested-images is-cropped columns-1\" >\n\t\n\n\t\n</figure>\n",
|
||||
"innerContent": [
|
||||
"\n<figure class=\"wp-block-gallery has-nested-images is-cropped columns-1\" >\n\t",
|
||||
null,
|
||||
"\n\n\t",
|
||||
null,
|
||||
"\n</figure>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockName": null,
|
||||
"attrs": {},
|
||||
@ -19,4 +49,4 @@
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
@ -1,3 +1,3 @@
|
||||
<!-- wp:gallery {"columns":1} -->
|
||||
<ul class="wp-block-gallery columns-1 is-cropped"><li class="blocks-gallery-item"><figure><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title"/></figure></li><li class="blocks-gallery-item"><figure><img src="http://google.com/hi.png" alt="title"/></figure></li></ul>
|
||||
<!-- /wp:gallery -->
|
||||
<!-- wp:gallery {"linkTo":"none","className":"columns-1"} -->
|
||||
<figure class="wp-block-gallery has-nested-images is-cropped columns-1"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} --><figure class="wp-block-image size-large"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" /></figure><!-- /wp:image --><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} --><figure class="wp-block-image size-large"><img src="http://google.com/hi.png" alt="Image gallery image" /></figure><!-- /wp:image --></figure>
|
||||
<!-- /wp:gallery -->
|
||||
@ -1,14 +1,15 @@
|
||||
|
||||
<ul class="wp-container-1 wp-block-gallery-1 wp-block-gallery columns-1 is-cropped">
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
<li class="blocks-gallery-item">
|
||||
<figure>
|
||||
<img src="http://google.com/hi.png" alt="title" />
|
||||
</figure>
|
||||
</li>
|
||||
</ul>
|
||||
<figure class="wp-container-1 wp-block-gallery-1 wp-block-gallery has-nested-images is-cropped columns-1" >
|
||||
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
|
||||
</figure>
|
||||
|
||||
|
||||
|
||||
<figure class="wp-block-image size-large">
|
||||
<img src="http://google.com/hi.png" alt="Image gallery image" />
|
||||
</figure>
|
||||
|
||||
</figure>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user