Skip to content
Merged
Prev Previous commit
Next Next commit
Add individual test fixtures for each block in the demo content
  • Loading branch information
nylen committed May 23, 2017
commit 3fc694a1afa0580ce153729bca4d5993bf0d2e35
3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-button-center.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/button align="center" -->
<div class="aligncenter"><a href="https://github.com/WordPress/gutenberg"><span>Help build Gutenberg</span></a></div>
<!-- /wp:core/button -->
13 changes: 13 additions & 0 deletions blocks/test/fixtures/core-button-center.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"uid": "_uid_0",
"blockType": "core/button",
"attributes": {
"align": "center",
"url": "https://github.com/WordPress/gutenberg",
"text": [
"Help build Gutenberg"
]
}
}
]
4 changes: 4 additions & 0 deletions blocks/test/fixtures/core-button-center.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- wp:core/button align="center" -->
<div class="aligncenter"><a href="https://github.com/WordPress/gutenberg">Help build Gutenberg</a></div>
<!-- /wp:core/button -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-embed-youtube-caption.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/embed url="https://www.youtube.com/watch?v=Nl6U7UotA-M" -->
<figure><iframe src="//www.youtube.com/embed/Nl6U7UotA-M" frameborder="0" allowfullscreen></iframe><figcaption>State of the Word 2016</figcaption></figure>
<!-- /wp:core/embed -->
12 changes: 12 additions & 0 deletions blocks/test/fixtures/core-embed-youtube-caption.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"uid": "_uid_0",
"blockType": "core/embed",
"attributes": {
"url": "//www.youtube.com/embed/Nl6U7UotA-M",
"caption": [
"State of the Word 2016"
]
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- wp:core/embed -->
<figure><iframe src="//www.youtube.com/embed/Nl6U7UotA-M"></iframe>
<figcaption>State of the Word 2016</figcaption>
</figure>
<!-- /wp:core/embed -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-heading-h2-em.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/heading -->
<h2>The <em>Inserter</em> Tool</h2>
<!-- /wp:core/heading -->
18 changes: 18 additions & 0 deletions blocks/test/fixtures/core-heading-h2-em.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"uid": "_uid_0",
"blockType": "core/heading",
"attributes": {
"content": [
"The ",
{
"type": "em",
"attributes": {},
"children": "Inserter"
},
" Tool"
],
"nodeName": "H2"
}
}
]
4 changes: 4 additions & 0 deletions blocks/test/fixtures/core-heading-h2-em.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- wp:core/heading -->
<h2>The <em>Inserter</em> Tool</h2>
<!-- /wp:core/heading -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-heading-h2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/heading -->
<h2>A picture is worth a thousand words, or so the saying goes</h2>
<!-- /wp:core/heading -->
12 changes: 12 additions & 0 deletions blocks/test/fixtures/core-heading-h2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"uid": "_uid_0",
"blockType": "core/heading",
"attributes": {
"content": [
"A picture is worth a thousand words, or so the saying goes"
],
"nodeName": "H2"
}
}
]
4 changes: 4 additions & 0 deletions blocks/test/fixtures/core-heading-h2.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- wp:core/heading -->
<h2>A picture is worth a thousand words, or so the saying goes</h2>
<!-- /wp:core/heading -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-image-center-caption.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/image align="center" -->
<figure><img src="https://cldup.com/YLYhpou2oq.jpg" class="aligncenter"/><figcaption>Give it a try. Press the &quot;really wide&quot; button on the image toolbar.</figcaption></figure>
<!-- /wp:core/image -->
13 changes: 13 additions & 0 deletions blocks/test/fixtures/core-image-center-caption.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"uid": "_uid_0",
"blockType": "core/image",
"attributes": {
"align": "center",
"url": "https://cldup.com/YLYhpou2oq.jpg",
"caption": [
"Give it a try. Press the \"really wide\" button on the image toolbar."
]
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- wp:core/image align="center" -->
<figure><img src="https://cldup.com/YLYhpou2oq.jpg" class="aligncenter" />
<figcaption>Give it a try. Press the &quot;really wide&quot; button on the image toolbar.</figcaption>
</figure>
<!-- /wp:core/image -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/image -->
<figure><img src="https://cldup.com/uuUqE_dXzy.jpg" /></figure>
<!-- /wp:core/image -->
10 changes: 10 additions & 0 deletions blocks/test/fixtures/core-image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"uid": "_uid_0",
"blockType": "core/image",
"attributes": {
"url": "https://cldup.com/uuUqE_dXzy.jpg",
"caption": []
}
}
]
4 changes: 4 additions & 0 deletions blocks/test/fixtures/core-image.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- wp:core/image -->
<img src="https://cldup.com/uuUqE_dXzy.jpg" class="alignnone" />
<!-- /wp:core/image -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-list-ul.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/list -->
<ul><li>Text & Headings</li><li>Images & Videos</li><li>Galleries</li><li>Embeds, like YouTube, Tweets, or other WordPress posts.</li><li>Layout blocks, like Buttons, Hero Images, Separators, etc.</li><li>And <em>Lists</em> like this one of course :)</li></ul>
<!-- /wp:core/list -->
49 changes: 49 additions & 0 deletions blocks/test/fixtures/core-list-ul.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[
{
"uid": "_uid_0",
"blockType": "core/list",
"attributes": {
"nodeName": "UL",
"values": [
{
"type": "li",
"attributes": {},
"children": "Text & Headings"
},
{
"type": "li",
"attributes": {},
"children": "Images & Videos"
},
{
"type": "li",
"attributes": {},
"children": "Galleries"
},
{
"type": "li",
"attributes": {},
"children": "Embeds, like YouTube, Tweets, or other WordPress posts."
},
{
"type": "li",
"attributes": {},
"children": "Layout blocks, like Buttons, Hero Images, Separators, etc."
},
{
"type": "li",
"attributes": {},
"children": [
"And ",
{
"type": "em",
"attributes": {},
"children": "Lists"
},
" like this one of course :)"
]
}
]
}
}
]
11 changes: 11 additions & 0 deletions blocks/test/fixtures/core-list-ul.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- wp:core/list -->
<ul>
<li>Text &amp; Headings</li>
<li>Images &amp; Videos</li>
<li>Galleries</li>
<li>Embeds, like YouTube, Tweets, or other WordPress posts.</li>
<li>Layout blocks, like Buttons, Hero Images, Separators, etc.</li>
<li>And <em>Lists</em> like this one of course :)</li>
</ul>
<!-- /wp:core/list -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-preformatted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/preformatted -->
<pre>Some <em>preformatted</em> text...<br>And more!</pre>
<!-- /wp:core/preformatted -->
22 changes: 22 additions & 0 deletions blocks/test/fixtures/core-preformatted.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"uid": "_uid_0",
"blockType": "core/preformatted",
"attributes": {
"content": [
"Some ",
{
"type": "em",
"attributes": {},
"children": "preformatted"
},
" text...",
{
"type": "br",
"attributes": {}
},
"And more!"
]
}
}
]
4 changes: 4 additions & 0 deletions blocks/test/fixtures/core-preformatted.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- wp:core/preformatted -->
<pre>Some <em>preformatted</em> text...<br/>And more!</pre>
<!-- /wp:core/preformatted -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-quote-style-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/quote style="1" -->
<blockquote class="blocks-quote-style-1"><p>The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.</p><footer>Matt Mullenweg, 2017</footer></blockquote>
<!-- /wp:core/quote -->
17 changes: 17 additions & 0 deletions blocks/test/fixtures/core-quote-style-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"uid": "_uid_0",
"blockType": "core/quote",
"attributes": {
"style": "1",
"value": [
[
"The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery."
]
],
"citation": [
"Matt Mullenweg, 2017"
]
}
}
]
7 changes: 7 additions & 0 deletions blocks/test/fixtures/core-quote-style-1.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- wp:core/quote style="1" -->
<blockquote class="blocks-quote-style-1">
<p>The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.</p>
<footer>Matt Mullenweg, 2017</footer>
</blockquote>
<!-- /wp:core/quote -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-quote-style-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/quote style="2" -->
<blockquote class="blocks-quote-style-2"><p>There is no greater agony than bearing an untold story inside you.</p><footer>Maya Angelou</footer></blockquote>
<!-- /wp:core/quote -->
17 changes: 17 additions & 0 deletions blocks/test/fixtures/core-quote-style-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"uid": "_uid_0",
"blockType": "core/quote",
"attributes": {
"style": "2",
"value": [
[
"There is no greater agony than bearing an untold story inside you."
]
],
"citation": [
"Maya Angelou"
]
}
}
]
7 changes: 7 additions & 0 deletions blocks/test/fixtures/core-quote-style-2.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- wp:core/quote style="2" -->
<blockquote class="blocks-quote-style-2">
<p>There is no greater agony than bearing an untold story inside you.</p>
<footer>Maya Angelou</footer>
</blockquote>
<!-- /wp:core/quote -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-separator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/separator -->
<hr/>
<!-- /wp:core/separator -->
7 changes: 7 additions & 0 deletions blocks/test/fixtures/core-separator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"uid": "_uid_0",
"blockType": "core/separator",
"attributes": {}
}
]
4 changes: 4 additions & 0 deletions blocks/test/fixtures/core-separator.serialized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- wp:core/separator -->
<hr/>
<!-- /wp:core/separator -->

3 changes: 3 additions & 0 deletions blocks/test/fixtures/core-table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:core/table -->
<table class="widefat"><thead><tr><th>Version</th><th>Musician</th><th>Date</th></tr></thead><tbody><tr class="alt"><th><a href="https://wordpress.org/news/2003/05/wordpress-now-available/">.70</a></th><td>No musician chosen.</td><td>May 27, 2003</td></tr><tr><th><a href="https://wordpress.org/news/2004/01/wordpress-10/">1.0</a></th><td>Miles Davis</td><td>January 3, 2004</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2004/05/heres-the-beef/">1.2</a></th><td>Charles Mingus</td><td>May 22, 2004</td></tr><tr><th><a href="https://wordpress.org/news/2005/02/strayhorn/">1.5</a></th><td>Billy Strayhorn</td><td>February 17, 2005</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2005/12/wp2/">2.0</a></th><td>Duke Ellington</td><td>December 31, 2005</td></tr><tr><th><a href="https://wordpress.org/news/2007/01/ella-21/">2.1</a></th><td>Ella Fitzgerald</td><td>January 22, 2007</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2007/05/wordpress-22/">2.2</a></th><td>Stan Getz</td><td>May 16, 2007</td></tr><tr><th><a href="https://wordpress.org/news/2007/09/wordpress-23/">2.3</a></th><td>Dexter Gordon</td><td>September 24, 2007</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2008/03/wordpress-25-brecker/">2.5</a></th><td>Michael Brecker</td><td>March 29, 2008</td></tr><tr><th><a href="https://wordpress.org/news/2008/07/wordpress-26-tyner/">2.6</a></th><td>McCoy Tyner</td><td>July 15, 2008</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2008/12/coltrane/">2.7</a></th><td>John Coltrane</td><td>December 10, 2008</td></tr><tr><th><a href="https://wordpress.org/news/2009/06/wordpress-28/">2.8</a></th><td>Chet Baker</td><td>June 11, 2009</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2009/12/wordpress-2-9/">2.9</a></th><td>Carmen McRae</td><td>December 18, 2009</td></tr><tr><th><a href="https://wordpress.org/news/2010/06/thelonious/">3.0</a></th><td>Thelonious Monk</td><td>June 17, 2010</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2011/02/threeone/">3.1</a></th><td>Django Reinhardt</td><td>February 23, 2011</td></tr><tr><th><a href="https://wordpress.org/news/2011/07/gershwin/">3.2</a></th><td>George Gershwin</td><td>July 4, 2011</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2011/12/sonny/">3.3</a></th><td>Sonny Stitt</td><td>December 12, 2011</td></tr><tr><th><a href="https://wordpress.org/news/2012/06/green/">3.4</a></th><td>Grant Green</td><td>June 13, 2012</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2012/12/elvin/">3.5</a></th><td>Elvin Jones</td><td>December 11, 2012</td></tr><tr><th><a href="https://wordpress.org/news/2013/08/oscar/">3.6</a></th><td>Oscar Peterson</td><td>August 1, 2013</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2013/10/basie/">3.7</a></th><td>Count Basie</td><td>October 24, 2013</td></tr><tr><th><a href="https://wordpress.org/news/2013/12/parker/">3.8</a></th><td>Charlie Parker</td><td>December 12, 2013</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2014/04/smith/">3.9</a></th><td>Jimmy Smith</td><td>April 16, 2014</td></tr><tr><th><a href="https://wordpress.org/news/2014/09/benny/">4.0</a></th><td>Benny Goodman</td><td>September 4, 2014</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2014/12/dinah/">4.1</a></th><td>Dinah Washington</td><td>December 18, 2014</td></tr><tr><th><a href="https://wordpress.org/news/2015/04/powell/">4.2</a></th><td>Bud Powell</td><td>April 23, 2015</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2015/08/billie/">4.3</a></th><td>Billie Holiday</td><td>August 18, 2015</td></tr><tr><th><a href="https://wordpress.org/news/2015/12/clifford/">4.4</a></th><td>Clifford Brown</td><td>December 8, 2015</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2016/04/coleman/">4.5</a></th><td>Coleman Hawkins</td><td>April 12, 2016</td></tr><tr><th><a href="https://wordpress.org/news/2016/08/pepper/">4.6</a></th><td>Pepper Adams</td><td>August 16, 2016</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2016/12/vaughan/">4.7</a></th><td>Sarah Vaughan</td><td>December 6, 2016</td></tr></tbody></table>
<!-- /wp:core/table -->
Loading