Skip to content

Commit

Permalink
Fix: media text vertical align fixture and block transforms structure. (
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Apr 3, 2019
1 parent ec5ed13 commit fc20eea
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
6 changes: 6 additions & 0 deletions packages/e2e-tests/fixtures/block-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export const EXPECTED_TRANSFORMS = {
'Video',
],
},
'core__media-text__vertical-align-bottom': {
originalBlock: 'Media & Text',
availableTransforms: [
'Image',
],
},
'core__media-text__video': {
originalBlock: 'Media & Text',
availableTransforms: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- wp:media-text {"mediaId":11,"mediaType":"image","verticalAlignment":"bottom"} -->
<!-- wp:media-text {"mediaType":"image","verticalAlignment":"bottom"} -->
<div class="wp-block-media-text alignwide is-vertically-aligned-bottom">
<figure class="wp-block-media-text__media"><img
src="http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg" alt="My alt text"
class="wp-image-11" /></figure>
src="data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=" alt="My alt text"
/></figure>
<div class="wp-block-media-text__content">
<!-- wp:paragraph {"placeholder":"Content…","fontSize":"large"} -->
<p class="has-large-font-size">My content</p>
<!-- /wp:paragraph -->
</div>
</div>
<!-- /wp:media-text -->
<!-- /wp:media-text -->
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"align": "wide",
"mediaAlt": "My alt text",
"mediaPosition": "left",
"mediaId": 11,
"mediaUrl": "http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg",
"mediaUrl": "data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=",
"mediaType": "image",
"mediaWidth": 50,
"isStackedOnMobile": false,
Expand All @@ -29,6 +28,6 @@
"originalContent": "<p class=\"has-large-font-size\">My content</p>"
}
],
"originalContent": "<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg\" alt=\"My alt text\"\n\t\t\tclass=\"wp-image-11\" /></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t\n\t</div>\n</div>"
"originalContent": "<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=\" alt=\"My alt text\"\n\t\t\t/></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t\n\t</div>\n</div>"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"blockName": "core/media-text",
"attrs": {
"mediaId": 11,
"mediaType": "image",
"verticalAlignment": "bottom"
},
Expand All @@ -20,11 +19,20 @@
]
}
],
"innerHTML": "\n<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg\" alt=\"My alt text\"\n\t\t\tclass=\"wp-image-11\" /></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t\n\t</div>\n</div>\n",
"innerHTML": "\n<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=\" alt=\"My alt text\"\n\t\t\t/></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t\n\t</div>\n</div>\n",
"innerContent": [
"\n<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg\" alt=\"My alt text\"\n\t\t\tclass=\"wp-image-11\" /></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t",
"\n<div class=\"wp-block-media-text alignwide is-vertically-aligned-bottom\">\n\t<figure class=\"wp-block-media-text__media\"><img\n\t\t\tsrc=\"data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=\" alt=\"My alt text\"\n\t\t\t/></figure>\n\t<div class=\"wp-block-media-text__content\">\n\t\t",
null,
"\n\t</div>\n</div>\n"
]
},
{
"blockName": null,
"attrs": {},
"innerBlocks": [],
"innerHTML": "\n",
"innerContent": [
"\n"
]
}
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:media-text {"mediaId":11,"mediaType":"image","verticalAlignment":"bottom"} -->
<div class="wp-block-media-text alignwide is-vertically-aligned-bottom"><figure class="wp-block-media-text__media"><img src="http://localhost:8888/wp-content/uploads/2019/03/Dzts-v2X0AMxju_-1024x1024.jpg" alt="My alt text" class="wp-image-11"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…","fontSize":"large"} -->
<!-- wp:media-text {"mediaType":"image","verticalAlignment":"bottom"} -->
<div class="wp-block-media-text alignwide is-vertically-aligned-bottom"><figure class="wp-block-media-text__media"><img src="data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=" alt="My alt text"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…","fontSize":"large"} -->
<p class="has-large-font-size">My content</p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:media-text -->
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ exports[`Block transforms correctly transform block Media & Text in fixture core
<!-- /wp:video -->"
`;
exports[`Block transforms correctly transform block Media & Text in fixture core__media-text__vertical-align-bottom into the Image block 1`] = `
"<!-- wp:image -->
<figure class=\\"wp-block-image\\"><img src=\\"data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=\\" alt=\\"My alt text\\"/></figure>
<!-- /wp:image -->"
`;
exports[`Block transforms correctly transform block Media & Text in fixture core__media-text__video into the Video block 1`] = `
"<!-- wp:video -->
<figure class=\\"wp-block-video\\"><video controls src=\\"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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