From 5e4d8e48c8fe8f47870dc58945007c78821d1f95 Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Sat, 14 Jul 2018 12:15:01 +0200 Subject: [PATCH 01/10] Build: new feature flag for gutenberg devdocs --- config/development.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config/development.json b/config/development.json index a364cff566382..8b041f6c242d2 100644 --- a/config/development.json +++ b/config/development.json @@ -44,6 +44,7 @@ "devdocs": true, "devdocs/redirect-loggedout-homepage": true, "devdocs/components-usage-stats": false, + "devdocs/gutenberg": false, "dev/test-helper": true, "dev/preferences-helper": true, "domains/cctlds": true, From 578ac063c39dbffd963fe5b04fb78fbe40aa0ba3 Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Sat, 14 Jul 2018 13:29:51 +0200 Subject: [PATCH 02/10] Devdocs: new section for Gutenberg blocks --- client/devdocs/controller.js | 8 ++++++++ client/devdocs/design/gutenberg.jsx | 26 ++++++++++++++++++++++++++ client/devdocs/gutenberg/README.md | 4 ++++ client/devdocs/index.js | 11 +++++++++++ client/devdocs/sidebar.jsx | 10 ++++++++++ config/development.json | 4 ++-- config/test.json | 3 ++- 7 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 client/devdocs/design/gutenberg.jsx create mode 100644 client/devdocs/gutenberg/README.md diff --git a/client/devdocs/controller.js b/client/devdocs/controller.js index 0c4a6329719a2..d581506ec79ea 100644 --- a/client/devdocs/controller.js +++ b/client/devdocs/controller.js @@ -162,6 +162,14 @@ const devdocs = { context.primary = React.createElement( DevWelcome, {} ); next(); }, + + // Gutenberg Blocks + gutenberg: function( context, next ) { + context.primary = ( + + ); + next(); + }, }; export default devdocs; diff --git a/client/devdocs/design/gutenberg.jsx b/client/devdocs/design/gutenberg.jsx new file mode 100644 index 0000000000000..534fac0f50c5a --- /dev/null +++ b/client/devdocs/design/gutenberg.jsx @@ -0,0 +1,26 @@ +/** + * External dependencies + */ +import React from 'react'; +import classnames from 'classnames'; + +/** + * Internal dependencies + */ +import DocumentHead from 'components/data/document-head'; +import Main from 'components/main'; +import ReadmeViewer from 'components/readme-viewer'; + + +export default class Gutenberg extends React.Component { + render() { + const className = classnames('devdocs', 'devdocs__gutenberg'); + + return ( +
+ + +
+ ); + } +} diff --git a/client/devdocs/gutenberg/README.md b/client/devdocs/gutenberg/README.md new file mode 100644 index 0000000000000..ad076c43c5ab5 --- /dev/null +++ b/client/devdocs/gutenberg/README.md @@ -0,0 +1,4 @@ +Gutenberg Blocks +==== + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ut arcu et mauris fermentum tempus. In vel lacinia lorem, nec accumsan tortor. Nulla non tellus interdum, vestibulum nisl sed, placerat metus. diff --git a/client/devdocs/index.js b/client/devdocs/index.js index eefbcfd63473d..ac1c7eb283d77 100644 --- a/client/devdocs/index.js +++ b/client/devdocs/index.js @@ -71,6 +71,17 @@ export default function() { ); page( '/devdocs/start', controller.pleaseLogIn, makeLayout, clientRender ); page( '/devdocs/welcome', controller.sidebar, controller.welcome, makeLayout, clientRender ); + + if ( config.isEnabled( 'devdocs/gutenberg' ) ) { + page( + '/devdocs/gutenberg', + controller.sidebar, + controller.gutenberg, + makeLayout, + clientRender + ); + } + page( '/devdocs/:path*', controller.sidebar, controller.singleDoc, makeLayout, clientRender ); } } diff --git a/client/devdocs/sidebar.jsx b/client/devdocs/sidebar.jsx index 21464dc507b9c..4a0062d966d08 100644 --- a/client/devdocs/sidebar.jsx +++ b/client/devdocs/sidebar.jsx @@ -13,6 +13,7 @@ import Sidebar from 'layout/sidebar'; import SidebarHeading from 'layout/sidebar/heading'; import SidebarMenu from 'layout/sidebar/menu'; import SidebarItem from 'layout/sidebar/item'; +import { isEnabled } from 'config'; export default class DevdocsSidebar extends React.PureComponent { static displayName = 'DevdocsSidebar'; @@ -103,6 +104,15 @@ export default class DevdocsSidebar extends React.PureComponent { link="/devdocs/blocks" selected={ this.isItemSelected( '/devdocs/blocks', false ) } /> + { isEnabled( 'devdocs/gutenberg' ) && ( + + ) } Date: Sat, 14 Jul 2018 17:04:03 +0200 Subject: [PATCH 03/10] Devdocs: tests covering the new section for Gutenberg blocks --- client/devdocs/design/gutenberg.jsx | 4 +- .../test/__snapshots__/gutenberg.js.snap | 14 ++++++ client/devdocs/design/test/gutenberg.js | 45 +++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 client/devdocs/design/test/__snapshots__/gutenberg.js.snap create mode 100644 client/devdocs/design/test/gutenberg.js diff --git a/client/devdocs/design/gutenberg.jsx b/client/devdocs/design/gutenberg.jsx index 534fac0f50c5a..33f7f546f496b 100644 --- a/client/devdocs/design/gutenberg.jsx +++ b/client/devdocs/design/gutenberg.jsx @@ -14,12 +14,12 @@ import ReadmeViewer from 'components/readme-viewer'; export default class Gutenberg extends React.Component { render() { - const className = classnames('devdocs', 'devdocs__gutenberg'); + const className = classnames( 'devdocs', 'devdocs__gutenberg' ); return (
- +
); } diff --git a/client/devdocs/design/test/__snapshots__/gutenberg.js.snap b/client/devdocs/design/test/__snapshots__/gutenberg.js.snap new file mode 100644 index 0000000000000..04469c4135683 --- /dev/null +++ b/client/devdocs/design/test/__snapshots__/gutenberg.js.snap @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Gutenberg should render 1`] = ` +
+ + +
+`; diff --git a/client/devdocs/design/test/gutenberg.js b/client/devdocs/design/test/gutenberg.js new file mode 100644 index 0000000000000..5832b1444a094 --- /dev/null +++ b/client/devdocs/design/test/gutenberg.js @@ -0,0 +1,45 @@ +/** + * External dependencies + */ +import React from 'react'; +import {shallow} from 'enzyme'; + +/** + * Internal dependencies + */ +import DocumentHead from 'components/data/document-head'; +import Gutenberg from '../gutenberg'; +import Main from 'components/main'; +import ReadmeViewer from 'components/readme-viewer'; + +describe('Gutenberg', () => { + test('should render', () => { + const wrapper = shallow(); + + expect(wrapper).toMatchSnapshot(); + }); + + test('should have a main component', () => { + const wrapper = shallow(); + const main = wrapper.find(Main); + + expect(main).toHaveLength(1); + expect(main.hasClass('devdocs devdocs__gutenberg')).toBe(true); + }); + + test('should have a document head component', () => { + const wrapper = shallow(); + const documentHead = wrapper.find(DocumentHead); + + expect(documentHead).toHaveLength(1); + expect(documentHead.props().title).toBe('Gutenberg Blocks'); + }); + + test('should have a readme viewer component', () => { + const wrapper = shallow(); + const readmeViewer = wrapper.find(ReadmeViewer); + + expect(readmeViewer).toHaveLength(1); + expect(readmeViewer.props().readmeFilePath).toBe('/client/devdocs/gutenberg/README.md'); + }); +}); From 9bd2254c72bb379cb0a9095ce8e84f04dcdfab8e Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Sat, 14 Jul 2018 17:08:14 +0200 Subject: [PATCH 04/10] Applying guidelines to tests covering the Gutenberg blocks in DevDocs --- client/devdocs/design/test/gutenberg.js | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/client/devdocs/design/test/gutenberg.js b/client/devdocs/design/test/gutenberg.js index 5832b1444a094..16e0edd6bf3fe 100644 --- a/client/devdocs/design/test/gutenberg.js +++ b/client/devdocs/design/test/gutenberg.js @@ -2,7 +2,7 @@ * External dependencies */ import React from 'react'; -import {shallow} from 'enzyme'; +import { shallow } from 'enzyme'; /** * Internal dependencies @@ -12,34 +12,34 @@ import Gutenberg from '../gutenberg'; import Main from 'components/main'; import ReadmeViewer from 'components/readme-viewer'; -describe('Gutenberg', () => { - test('should render', () => { - const wrapper = shallow(); +describe( 'Gutenberg', () => { + test( 'should render', () => { + const wrapper = shallow( ); - expect(wrapper).toMatchSnapshot(); - }); + expect( wrapper ).toMatchSnapshot(); + } ); - test('should have a main component', () => { - const wrapper = shallow(); - const main = wrapper.find(Main); + test( 'should have a main component', () => { + const wrapper = shallow( ); + const main = wrapper.find( Main ); - expect(main).toHaveLength(1); - expect(main.hasClass('devdocs devdocs__gutenberg')).toBe(true); - }); + expect( main ).toHaveLength( 1 ); + expect( main.hasClass( 'devdocs devdocs__gutenberg' ) ).toBe( true ); + } ); - test('should have a document head component', () => { - const wrapper = shallow(); - const documentHead = wrapper.find(DocumentHead); + test( 'should have a document head component', () => { + const wrapper = shallow( ); + const documentHead = wrapper.find( DocumentHead ); - expect(documentHead).toHaveLength(1); - expect(documentHead.props().title).toBe('Gutenberg Blocks'); - }); + expect( documentHead ).toHaveLength( 1 ); + expect( documentHead.props().title ).toBe( 'Gutenberg Blocks' ); + } ); - test('should have a readme viewer component', () => { - const wrapper = shallow(); - const readmeViewer = wrapper.find(ReadmeViewer); + test( 'should have a readme viewer component', () => { + const wrapper = shallow( ); + const readmeViewer = wrapper.find( ReadmeViewer ); - expect(readmeViewer).toHaveLength(1); - expect(readmeViewer.props().readmeFilePath).toBe('/client/devdocs/gutenberg/README.md'); - }); -}); + expect( readmeViewer ).toHaveLength( 1 ); + expect( readmeViewer.props().readmeFilePath ).toBe( '/client/devdocs/gutenberg/README.md' ); + } ); +} ); From 6ae407d73c8e296844189819b1109305c47dd973 Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Tue, 17 Jul 2018 15:17:53 +0200 Subject: [PATCH 05/10] renaming gutenberg to gutenberg-blocks inside the devdocs --- client/devdocs/controller.js | 4 ++-- .../design/{gutenberg.jsx => gutenberg-blocks.jsx} | 6 +++--- ...{gutenberg.js.snap => gutenberg-blocks.js.snap} | 4 ++-- .../test/{gutenberg.js => gutenberg-blocks.js} | 14 +++++++------- .../{gutenberg => gutenberg-blocks}/README.md | 0 client/devdocs/index.js | 6 +++--- client/devdocs/sidebar.jsx | 6 +++--- config/development.json | 2 +- config/test.json | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) rename client/devdocs/design/{gutenberg.jsx => gutenberg-blocks.jsx} (65%) rename client/devdocs/design/test/__snapshots__/{gutenberg.js.snap => gutenberg-blocks.js.snap} (62%) rename client/devdocs/design/test/{gutenberg.js => gutenberg-blocks.js} (72%) rename client/devdocs/{gutenberg => gutenberg-blocks}/README.md (100%) diff --git a/client/devdocs/controller.js b/client/devdocs/controller.js index d581506ec79ea..93142f1b33248 100644 --- a/client/devdocs/controller.js +++ b/client/devdocs/controller.js @@ -164,9 +164,9 @@ const devdocs = { }, // Gutenberg Blocks - gutenberg: function( context, next ) { + gutenbergBlocks: function( context, next ) { context.primary = ( - + ); next(); }, diff --git a/client/devdocs/design/gutenberg.jsx b/client/devdocs/design/gutenberg-blocks.jsx similarity index 65% rename from client/devdocs/design/gutenberg.jsx rename to client/devdocs/design/gutenberg-blocks.jsx index 33f7f546f496b..1443e4a6f31dd 100644 --- a/client/devdocs/design/gutenberg.jsx +++ b/client/devdocs/design/gutenberg-blocks.jsx @@ -12,14 +12,14 @@ import Main from 'components/main'; import ReadmeViewer from 'components/readme-viewer'; -export default class Gutenberg extends React.Component { +export default class GutenbergBlocks extends React.Component { render() { - const className = classnames( 'devdocs', 'devdocs__gutenberg' ); + const className = classnames( 'devdocs', 'devdocs__gutenberg-blocks' ); return (
- +
); } diff --git a/client/devdocs/design/test/__snapshots__/gutenberg.js.snap b/client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap similarity index 62% rename from client/devdocs/design/test/__snapshots__/gutenberg.js.snap rename to client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap index 04469c4135683..2f06a584a9a1f 100644 --- a/client/devdocs/design/test/__snapshots__/gutenberg.js.snap +++ b/client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap @@ -2,13 +2,13 @@ exports[`Gutenberg should render 1`] = `
`; diff --git a/client/devdocs/design/test/gutenberg.js b/client/devdocs/design/test/gutenberg-blocks.js similarity index 72% rename from client/devdocs/design/test/gutenberg.js rename to client/devdocs/design/test/gutenberg-blocks.js index 16e0edd6bf3fe..1b2c22e5c9584 100644 --- a/client/devdocs/design/test/gutenberg.js +++ b/client/devdocs/design/test/gutenberg-blocks.js @@ -8,27 +8,27 @@ import { shallow } from 'enzyme'; * Internal dependencies */ import DocumentHead from 'components/data/document-head'; -import Gutenberg from '../gutenberg'; +import GutenbergBlocks from '../gutenberg-blocks'; import Main from 'components/main'; import ReadmeViewer from 'components/readme-viewer'; describe( 'Gutenberg', () => { test( 'should render', () => { - const wrapper = shallow( ); + const wrapper = shallow( ); expect( wrapper ).toMatchSnapshot(); } ); test( 'should have a main component', () => { - const wrapper = shallow( ); + const wrapper = shallow( ); const main = wrapper.find( Main ); expect( main ).toHaveLength( 1 ); - expect( main.hasClass( 'devdocs devdocs__gutenberg' ) ).toBe( true ); + expect( main.hasClass( 'devdocs devdocs__gutenberg-blocks' ) ).toBe( true ); } ); test( 'should have a document head component', () => { - const wrapper = shallow( ); + const wrapper = shallow( ); const documentHead = wrapper.find( DocumentHead ); expect( documentHead ).toHaveLength( 1 ); @@ -36,10 +36,10 @@ describe( 'Gutenberg', () => { } ); test( 'should have a readme viewer component', () => { - const wrapper = shallow( ); + const wrapper = shallow( ); const readmeViewer = wrapper.find( ReadmeViewer ); expect( readmeViewer ).toHaveLength( 1 ); - expect( readmeViewer.props().readmeFilePath ).toBe( '/client/devdocs/gutenberg/README.md' ); + expect( readmeViewer.props().readmeFilePath ).toBe( '/client/devdocs/gutenberg-blocks/README.md' ); } ); } ); diff --git a/client/devdocs/gutenberg/README.md b/client/devdocs/gutenberg-blocks/README.md similarity index 100% rename from client/devdocs/gutenberg/README.md rename to client/devdocs/gutenberg-blocks/README.md diff --git a/client/devdocs/index.js b/client/devdocs/index.js index ac1c7eb283d77..64507abbfb4c7 100644 --- a/client/devdocs/index.js +++ b/client/devdocs/index.js @@ -72,11 +72,11 @@ export default function() { page( '/devdocs/start', controller.pleaseLogIn, makeLayout, clientRender ); page( '/devdocs/welcome', controller.sidebar, controller.welcome, makeLayout, clientRender ); - if ( config.isEnabled( 'devdocs/gutenberg' ) ) { + if ( config.isEnabled( 'devdocs/gutenberg-blocks' ) ) { page( - '/devdocs/gutenberg', + '/devdocs/gutenberg-blocks', controller.sidebar, - controller.gutenberg, + controller.gutenbergBlocks, makeLayout, clientRender ); diff --git a/client/devdocs/sidebar.jsx b/client/devdocs/sidebar.jsx index 4a0062d966d08..d11f4bd83e55e 100644 --- a/client/devdocs/sidebar.jsx +++ b/client/devdocs/sidebar.jsx @@ -104,13 +104,13 @@ export default class DevdocsSidebar extends React.PureComponent { link="/devdocs/blocks" selected={ this.isItemSelected( '/devdocs/blocks', false ) } /> - { isEnabled( 'devdocs/gutenberg' ) && ( + { isEnabled( 'devdocs/gutenberg-blocks' ) && ( ) } Date: Tue, 17 Jul 2018 16:01:16 +0200 Subject: [PATCH 06/10] Adding documentation about Gutenberg documentation --- client/devdocs/gutenberg-blocks/README.md | 5 ++++- client/gutenberg-blocks/README.md | 16 ++++++++++++++++ docs/components.md | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 client/gutenberg-blocks/README.md diff --git a/client/devdocs/gutenberg-blocks/README.md b/client/devdocs/gutenberg-blocks/README.md index ad076c43c5ab5..b7941656143b2 100644 --- a/client/devdocs/gutenberg-blocks/README.md +++ b/client/devdocs/gutenberg-blocks/README.md @@ -1,4 +1,7 @@ Gutenberg Blocks ==== -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ut arcu et mauris fermentum tempus. In vel lacinia lorem, nec accumsan tortor. Nulla non tellus interdum, vestibulum nisl sed, placerat metus. +Gutenberg Blocks are the components used in the Guterberg editor for creating content. + +Check out the [Gutenberg Blocks documentation](client/gutenberg-blocks/README.md) for more +information. diff --git a/client/gutenberg-blocks/README.md b/client/gutenberg-blocks/README.md new file mode 100644 index 0000000000000..f3b0a9317b995 --- /dev/null +++ b/client/gutenberg-blocks/README.md @@ -0,0 +1,16 @@ +Gutenberg Blocks +==== + +[Gutenberg](https://wordpress.org/gutenberg/) is the new publishing experience for WordPress. + +The Gutenberg editor uses +[blocks](https://github.com/WordPress/gutenberg/blob/master/blocks/README.md) to create all types +of content. A Gutenberg block is the abstract term used to describe units of markup that, +composed together, form the content or layout of a webpage. + +Calypso provides all the +[built-in Gutenberg blocks](https://github.com/WordPress/gutenberg/tree/master/core-blocks), so +they can be used in any React component. + +Our [DevDocs: Gutenberg Blocks](../../gutenberg-blocks) section displays the collection of +Gutenberg Blocks available. diff --git a/docs/components.md b/docs/components.md index a403eb08c5755..dfd6923fad040 100644 --- a/docs/components.md +++ b/docs/components.md @@ -10,6 +10,8 @@ You will encounter the following types of components in Calypso: * [UI components](../client/components/README.md) (UI primitives) * [Blocks](../client/blocks/README.md) (components which are connected to state, or otherwise directly represent application entities) +* [Gutenberg Blocks](../client/gutenberg-blocks/README.md) (components which are used in the +Gutenberg editor for creating content) * [Query components](./our-approach-to-data.md#query-components) (which handle data querying but don’t render anything) * Higher-order components (which encapsulate and provide functionality) * Section components (which are domain specific and not meant to be reused) From 0ffc6363ee07349c1efb58bd141585b934c101b8 Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Tue, 17 Jul 2018 22:39:33 +0200 Subject: [PATCH 07/10] Removing Gutenberg blocks documentation as it cannot be controlled with feature flag --- client/devdocs/gutenberg-blocks/README.md | 12 +++++++++--- client/gutenberg-blocks/README.md | 16 ---------------- docs/components.md | 2 -- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 client/gutenberg-blocks/README.md diff --git a/client/devdocs/gutenberg-blocks/README.md b/client/devdocs/gutenberg-blocks/README.md index b7941656143b2..00e7db93fd725 100644 --- a/client/devdocs/gutenberg-blocks/README.md +++ b/client/devdocs/gutenberg-blocks/README.md @@ -1,7 +1,13 @@ Gutenberg Blocks ==== -Gutenberg Blocks are the components used in the Guterberg editor for creating content. +[Gutenberg](https://wordpress.org/gutenberg/) is the new publishing experience for WordPress. -Check out the [Gutenberg Blocks documentation](client/gutenberg-blocks/README.md) for more -information. +The Gutenberg editor uses +[blocks](https://github.com/WordPress/gutenberg/blob/master/blocks/README.md) to create all types +of content. A Gutenberg block is the abstract term used to describe units of markup that, +composed together, form the content or layout of a webpage. + +Calypso provides all the +[built-in Gutenberg blocks](https://github.com/WordPress/gutenberg/tree/master/core-blocks), so +they can be used in any React component. diff --git a/client/gutenberg-blocks/README.md b/client/gutenberg-blocks/README.md deleted file mode 100644 index f3b0a9317b995..0000000000000 --- a/client/gutenberg-blocks/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Gutenberg Blocks -==== - -[Gutenberg](https://wordpress.org/gutenberg/) is the new publishing experience for WordPress. - -The Gutenberg editor uses -[blocks](https://github.com/WordPress/gutenberg/blob/master/blocks/README.md) to create all types -of content. A Gutenberg block is the abstract term used to describe units of markup that, -composed together, form the content or layout of a webpage. - -Calypso provides all the -[built-in Gutenberg blocks](https://github.com/WordPress/gutenberg/tree/master/core-blocks), so -they can be used in any React component. - -Our [DevDocs: Gutenberg Blocks](../../gutenberg-blocks) section displays the collection of -Gutenberg Blocks available. diff --git a/docs/components.md b/docs/components.md index dfd6923fad040..a403eb08c5755 100644 --- a/docs/components.md +++ b/docs/components.md @@ -10,8 +10,6 @@ You will encounter the following types of components in Calypso: * [UI components](../client/components/README.md) (UI primitives) * [Blocks](../client/blocks/README.md) (components which are connected to state, or otherwise directly represent application entities) -* [Gutenberg Blocks](../client/gutenberg-blocks/README.md) (components which are used in the -Gutenberg editor for creating content) * [Query components](./our-approach-to-data.md#query-components) (which handle data querying but don’t render anything) * Higher-order components (which encapsulate and provide functionality) * Section components (which are domain specific and not meant to be reused) From 4b3ffff01f7574ad71177716a7a6a6cbc53e69db Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Tue, 17 Jul 2018 22:49:58 +0200 Subject: [PATCH 08/10] removing unit tests that were not checking any behavior --- .../__snapshots__/gutenberg-blocks.js.snap | 14 ------ .../devdocs/design/test/gutenberg-blocks.js | 45 ------------------- 2 files changed, 59 deletions(-) delete mode 100644 client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap delete mode 100644 client/devdocs/design/test/gutenberg-blocks.js diff --git a/client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap b/client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap deleted file mode 100644 index 2f06a584a9a1f..0000000000000 --- a/client/devdocs/design/test/__snapshots__/gutenberg-blocks.js.snap +++ /dev/null @@ -1,14 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Gutenberg should render 1`] = ` -
- - -
-`; diff --git a/client/devdocs/design/test/gutenberg-blocks.js b/client/devdocs/design/test/gutenberg-blocks.js deleted file mode 100644 index 1b2c22e5c9584..0000000000000 --- a/client/devdocs/design/test/gutenberg-blocks.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * External dependencies - */ -import React from 'react'; -import { shallow } from 'enzyme'; - -/** - * Internal dependencies - */ -import DocumentHead from 'components/data/document-head'; -import GutenbergBlocks from '../gutenberg-blocks'; -import Main from 'components/main'; -import ReadmeViewer from 'components/readme-viewer'; - -describe( 'Gutenberg', () => { - test( 'should render', () => { - const wrapper = shallow( ); - - expect( wrapper ).toMatchSnapshot(); - } ); - - test( 'should have a main component', () => { - const wrapper = shallow( ); - const main = wrapper.find( Main ); - - expect( main ).toHaveLength( 1 ); - expect( main.hasClass( 'devdocs devdocs__gutenberg-blocks' ) ).toBe( true ); - } ); - - test( 'should have a document head component', () => { - const wrapper = shallow( ); - const documentHead = wrapper.find( DocumentHead ); - - expect( documentHead ).toHaveLength( 1 ); - expect( documentHead.props().title ).toBe( 'Gutenberg Blocks' ); - } ); - - test( 'should have a readme viewer component', () => { - const wrapper = shallow( ); - const readmeViewer = wrapper.find( ReadmeViewer ); - - expect( readmeViewer ).toHaveLength( 1 ); - expect( readmeViewer.props().readmeFilePath ).toBe( '/client/devdocs/gutenberg-blocks/README.md' ); - } ); -} ); From 29fbff22455a4b5cdfe760995a58eaf49052f99f Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Tue, 17 Jul 2018 22:52:47 +0200 Subject: [PATCH 09/10] reverting order of the feature flags --- config/development.json | 2 +- config/test.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/development.json b/config/development.json index 11311148577df..a0e5c9260da6d 100644 --- a/config/development.json +++ b/config/development.json @@ -42,9 +42,9 @@ "css-hot-reload": true, "desktop-promo": true, "devdocs": true, + "devdocs/redirect-loggedout-homepage": true, "devdocs/components-usage-stats": false, "devdocs/gutenberg-blocks": true, - "devdocs/redirect-loggedout-homepage": true, "dev/test-helper": true, "dev/preferences-helper": true, "domains/cctlds": true, diff --git a/config/test.json b/config/test.json index d2a7b9b1ea216..89bdcac84f11a 100644 --- a/config/test.json +++ b/config/test.json @@ -32,9 +32,9 @@ "code-splitting": true, "desktop-promo": true, "devdocs": true, + "devdocs/redirect-loggedout-homepage": true, "devdocs/components-usage-stats": false, "devdocs/gutenberg-blocks": true, - "devdocs/redirect-loggedout-homepage": true, "gdpr-banner": false, "google-analytics": false, "google-my-business": false, From 4d858f0f59ee3390073af1e4e817e35d1fffd0d9 Mon Sep 17 00:00:00 2001 From: Miguel Torres Date: Tue, 17 Jul 2018 23:07:15 +0200 Subject: [PATCH 10/10] adding @format so prettier handles whitespace formatting --- client/devdocs/design/gutenberg-blocks.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/devdocs/design/gutenberg-blocks.jsx b/client/devdocs/design/gutenberg-blocks.jsx index 1443e4a6f31dd..53b654007d569 100644 --- a/client/devdocs/design/gutenberg-blocks.jsx +++ b/client/devdocs/design/gutenberg-blocks.jsx @@ -1,3 +1,5 @@ +/** @format */ + /** * External dependencies */ @@ -11,15 +13,14 @@ import DocumentHead from 'components/data/document-head'; import Main from 'components/main'; import ReadmeViewer from 'components/readme-viewer'; - export default class GutenbergBlocks extends React.Component { render() { const className = classnames( 'devdocs', 'devdocs__gutenberg-blocks' ); return (
- - + +
); }