From 8e1f22b0321a1fd62960fa71f01dd1153b61e078 Mon Sep 17 00:00:00 2001 From: eanplatter Date: Fri, 12 Aug 2016 23:58:26 -0500 Subject: [PATCH 1/2] begin comment --- .../Comment/Types/CommentCommentsExample.js | 78 +++++++++++++++++++ src/views/Comment/Comment.js | 20 +++++ src/views/Comment/CommentAction.js | 23 ++++++ src/views/Comment/CommentAuthor.js | 23 ++++++ src/views/Comment/CommentAvatar.js | 23 ++++++ src/views/Comment/CommentContent.js | 23 ++++++ src/views/Comment/CommentGroup.js | 23 ++++++ src/views/Comment/CommentMeta.js | 22 ++++++ src/views/Comment/CommentText.js | 21 +++++ test/specs/commonTests.js | 1 + test/specs/views/Comment/Comment-test.js | 8 ++ 11 files changed, 265 insertions(+) create mode 100644 docs/app/Examples/views/Comment/Types/CommentCommentsExample.js create mode 100644 src/views/Comment/Comment.js create mode 100644 src/views/Comment/CommentAction.js create mode 100644 src/views/Comment/CommentAuthor.js create mode 100644 src/views/Comment/CommentAvatar.js create mode 100644 src/views/Comment/CommentContent.js create mode 100644 src/views/Comment/CommentGroup.js create mode 100644 src/views/Comment/CommentMeta.js create mode 100644 src/views/Comment/CommentText.js create mode 100644 test/specs/views/Comment/Comment-test.js diff --git a/docs/app/Examples/views/Comment/Types/CommentCommentsExample.js b/docs/app/Examples/views/Comment/Types/CommentCommentsExample.js new file mode 100644 index 0000000000..72c16fb09d --- /dev/null +++ b/docs/app/Examples/views/Comment/Types/CommentCommentsExample.js @@ -0,0 +1,78 @@ +import React from 'react' +import { Comment } from 'stardust' + +const CommentCommentsExample = () => ( + +
Comments
+ + + + + + Matt + + Today at 5:42PM + + + How artistic! + + + Reply + + + + + + + + + Elliot Fu + + Yesterday at 12:30AM + + +

This has been very useful for my research. Thanks as well!

+
+ + Reply + +
+ + + + + + + Jenny Hess + + Just now + + + Elliot you are always so right :) + + + Reply + + + + +
+ + + + + + Joe Henderson + + 5 days ago + + + Dude, this is awesome. Thanks so much + + + Reply + + + +
+) diff --git a/src/views/Comment/Comment.js b/src/views/Comment/Comment.js new file mode 100644 index 0000000000..d1a1e806c5 --- /dev/null +++ b/src/views/Comment/Comment.js @@ -0,0 +1,20 @@ +import React, { PropTypes } from 'react' +import { META } from '../../lib' + +const _meta = { + name: 'Comment', + type: META.TYPES.VIEW, + props: {}, +} + +function Comment(props) { + return ( +
+ +
+ ) +} + +Comment._meta = _meta + +export default Comment diff --git a/src/views/Comment/CommentAction.js b/src/views/Comment/CommentAction.js new file mode 100644 index 0000000000..3b0d364b8d --- /dev/null +++ b/src/views/Comment/CommentAction.js @@ -0,0 +1,23 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'Comment', + type: META.TYPES.VIEW, + props: {}, +} + +function CommentAction(props) { + const rest = getUnhandledProps(CommentAction, props) + return ( +
+ +
+ ) +} + +CommentAction._meta = _meta + + +export default CommentAction diff --git a/src/views/Comment/CommentAuthor.js b/src/views/Comment/CommentAuthor.js new file mode 100644 index 0000000000..fa0a7113a8 --- /dev/null +++ b/src/views/Comment/CommentAuthor.js @@ -0,0 +1,23 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'Comment', + type: META.TYPES.VIEW, + props: {}, +} + +function CommentAuthor(props) { + const rest = getUnhandledProps(CommentAuthor, props) + return ( +
+ +
+ ) +} + +CommentAuthor._meta = _meta + + +export default CommentAuthor diff --git a/src/views/Comment/CommentAvatar.js b/src/views/Comment/CommentAvatar.js new file mode 100644 index 0000000000..18cb17ba5d --- /dev/null +++ b/src/views/Comment/CommentAvatar.js @@ -0,0 +1,23 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'Comment', + type: META.TYPES.VIEW, + props: {}, +} + +function CommentAvatar(props) { + const rest = getUnhandledProps(CommentAvatar, props) + return ( +
+ +
+ ) +} + +CommentAvatar._meta = _meta + + +export default CommentAvatar diff --git a/src/views/Comment/CommentContent.js b/src/views/Comment/CommentContent.js new file mode 100644 index 0000000000..4ed6ede66a --- /dev/null +++ b/src/views/Comment/CommentContent.js @@ -0,0 +1,23 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'Comment', + type: META.TYPES.VIEW, + props: {}, +} + +function CommentContent(props) { + const rest = getUnhandledProps(CommentContent, props) + return ( +
+ +
+ ) +} + +CommentContent._meta = _meta + + +export default CommentContent diff --git a/src/views/Comment/CommentGroup.js b/src/views/Comment/CommentGroup.js new file mode 100644 index 0000000000..a4a01a0d72 --- /dev/null +++ b/src/views/Comment/CommentGroup.js @@ -0,0 +1,23 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'CommentGroup', + type: META.TYPES.VIEW, + props: {}, +} + +function CommentGroup(props) { + const rest = getUnhandledProps(CommentGroup, props) + return ( +
+ +
+ ) +} + +CommentGroup._meta = _meta + + +export default CommentGroup diff --git a/src/views/Comment/CommentMeta.js b/src/views/Comment/CommentMeta.js new file mode 100644 index 0000000000..a2eb747edb --- /dev/null +++ b/src/views/Comment/CommentMeta.js @@ -0,0 +1,22 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'CommentMeta', + type: META.TYPES.VIEW, +} + +function CommentMeta(props) { + const rest = getUnhandledProps(CommentMeta, props) + return ( +
+ +
+ ) +} + +CommentMeta._meta = _meta + + +export default CommentMeta diff --git a/src/views/Comment/CommentText.js b/src/views/Comment/CommentText.js new file mode 100644 index 0000000000..edadb56044 --- /dev/null +++ b/src/views/Comment/CommentText.js @@ -0,0 +1,21 @@ +import React from 'react' + +import { META, getUnhandledProps } from '../../lib' + +const _meta = { + name: 'CommentText', + type: META.TYPES.VIEW, +} + +function CommentText(props) { + const rest = getUnhandledProps(CommentText, props) + return ( +
+ +
+ ) +} + +CommentText._meta = _meta + +export default CommentText diff --git a/test/specs/commonTests.js b/test/specs/commonTests.js index 75281f4ccf..6fd9f1ca4a 100644 --- a/test/specs/commonTests.js +++ b/test/specs/commonTests.js @@ -26,6 +26,7 @@ const componentCtx = require.context( const componentInfo = componentCtx.keys().map(key => { const Component = componentCtx(key).default + console.log(Component) const { _meta, prototype } = Component if (!_meta) { diff --git a/test/specs/views/Comment/Comment-test.js b/test/specs/views/Comment/Comment-test.js new file mode 100644 index 0000000000..c8e0c49f89 --- /dev/null +++ b/test/specs/views/Comment/Comment-test.js @@ -0,0 +1,8 @@ +import Comment from 'src/views/Comment/Comment' +import * as common from 'test/specs/commonTests' + +describe('Comment', () => { + common.isConformant(Comment) + common.rendersChildren(Comment) + common.hasSubComponents(Comment, []) +}) From 51f52fd5e696407e4d8e06c3cc5d7218b1e0b344 Mon Sep 17 00:00:00 2001 From: eanplatter Date: Sat, 13 Aug 2016 17:21:08 -0500 Subject: [PATCH 2/2] fix conformance test formatting --- test/specs/views/Comment/Comment-test.js | 21 ++++++++++++++++++- .../views/Comment/CommentActions-test.js | 7 ++++++- .../specs/views/Comment/CommentAuthor-test.js | 7 ++++++- .../specs/views/Comment/CommentAvatar-test.js | 7 ++++++- .../views/Comment/CommentContent-test.js | 7 ++++++- test/specs/views/Comment/CommentGroup-test.js | 7 ++++++- test/specs/views/Comment/CommentMeta-test.js | 7 ++++++- test/specs/views/Comment/CommentText-test.js | 7 ++++++- 8 files changed, 62 insertions(+), 8 deletions(-) diff --git a/test/specs/views/Comment/Comment-test.js b/test/specs/views/Comment/Comment-test.js index e8a8594133..0d780308b2 100644 --- a/test/specs/views/Comment/Comment-test.js +++ b/test/specs/views/Comment/Comment-test.js @@ -1 +1,20 @@ -import Comment from 'src/views/Comment/Comment' import CommentActions from 'src/views/Comment/CommentActions' import CommentAuthor from 'src/views/Comment/CommentAuthor' import CommentAvatar from 'src/views/Comment/CommentAvatar' import CommentContent from 'src/views/Comment/CommentContent' import CommentMeta from 'src/views/Comment/CommentMeta' import CommentText from 'src/views/Comment/CommentText' import * as common from 'test/specs/commonTests' describe.only('Comment', () => { common.isConformant(Comment) common.rendersChildren(Comment) common.hasSubComponents(Comment, [ CommentActions, CommentAuthor, CommentAvatar, CommentContent, CommentMeta, CommentText, ]) }) +import Comment from 'src/views/Comment/Comment' +import CommentActions from 'src/views/Comment/CommentActions' +import CommentAuthor from 'src/views/Comment/CommentAuthor' +import CommentAvatar from 'src/views/Comment/CommentAvatar' +import CommentContent from 'src/views/Comment/CommentContent' +import CommentMeta from 'src/views/Comment/CommentMeta' +import CommentText from 'src/views/Comment/CommentText' +import * as common from 'test/specs/commonTests' +describe.only('Comment', () => { + common.isConformant(Comment) + common.rendersChildren(Comment) + common.hasSubComponents(Comment, [ + CommentActions, + CommentAuthor, + CommentAvatar, + CommentContent, + CommentMeta, + CommentText, + ]) +}) diff --git a/test/specs/views/Comment/CommentActions-test.js b/test/specs/views/Comment/CommentActions-test.js index e80fac4b73..d74139b820 100644 --- a/test/specs/views/Comment/CommentActions-test.js +++ b/test/specs/views/Comment/CommentActions-test.js @@ -1 +1,6 @@ -import CommentActions from 'src/views/CommentActions/CommentActions' import * as common from 'test/specs/commonTests' describe.only('CommentActions', () => { common.isConformant(CommentActions) common.rendersChildren(CommentActions) }) +import CommentActions from 'src/views/CommentActions/CommentActions' +import * as common from 'test/specs/commonTests' +describe.only('CommentActions', () => { + common.isConformant(CommentActions) + common.rendersChildren(CommentActions) +}) diff --git a/test/specs/views/Comment/CommentAuthor-test.js b/test/specs/views/Comment/CommentAuthor-test.js index 3db030cc60..24caf0d064 100644 --- a/test/specs/views/Comment/CommentAuthor-test.js +++ b/test/specs/views/Comment/CommentAuthor-test.js @@ -1 +1,6 @@ -import CommentAuthor from 'src/views/CommentAuthor/CommentAuthor' import * as common from 'test/specs/commonTests' describe.only('CommentAuthor', () => { common.isConformant(CommentAuthor) common.rendersChildren(CommentAuthor) }) +import CommentAuthor from 'src/views/CommentAuthor/CommentAuthor' +import * as common from 'test/specs/commonTests' +describe.only('CommentAuthor', () => { + common.isConformant(CommentAuthor) + common.rendersChildren(CommentAuthor) +}) diff --git a/test/specs/views/Comment/CommentAvatar-test.js b/test/specs/views/Comment/CommentAvatar-test.js index 2e454fa3a1..91f972a483 100644 --- a/test/specs/views/Comment/CommentAvatar-test.js +++ b/test/specs/views/Comment/CommentAvatar-test.js @@ -1 +1,6 @@ -import CommentAvatar from 'src/views/CommentAvatar/CommentAvatar' import * as common from 'test/specs/commonTests' describe.only('CommentAvatar', () => { common.isConformant(CommentAvatar) common.rendersChildren(CommentAvatar) }) +import CommentAvatar from 'src/views/CommentAvatar/CommentAvatar' +import * as common from 'test/specs/commonTests' +describe.only('CommentAvatar', () => { + common.isConformant(CommentAvatar) + common.rendersChildren(CommentAvatar) +}) diff --git a/test/specs/views/Comment/CommentContent-test.js b/test/specs/views/Comment/CommentContent-test.js index 36dc731a18..45989985a0 100644 --- a/test/specs/views/Comment/CommentContent-test.js +++ b/test/specs/views/Comment/CommentContent-test.js @@ -1 +1,6 @@ -import CommentContent from 'src/views/CommentContent/CommentContent' import * as common from 'test/specs/commonTests' describe.only('CommentContent', () => { common.isConformant(CommentContent) common.rendersChildren(CommentContent) }) +import CommentContent from 'src/views/CommentContent/CommentContent' +import * as common from 'test/specs/commonTests' +describe.only('CommentContent', () => { + common.isConformant(CommentContent) + common.rendersChildren(CommentContent) +}) diff --git a/test/specs/views/Comment/CommentGroup-test.js b/test/specs/views/Comment/CommentGroup-test.js index 2e4a86d971..38c3e03ce8 100644 --- a/test/specs/views/Comment/CommentGroup-test.js +++ b/test/specs/views/Comment/CommentGroup-test.js @@ -1 +1,6 @@ -import CommentGroup from 'src/views/CommentGroup/CommentGroup' import * as common from 'test/specs/commonTests' describe.only('CommentGroup', () => { common.isConformant(CommentGroup) common.rendersChildren(CommentGroup) }) +import CommentGroup from 'src/views/CommentGroup/CommentGroup' +import * as common from 'test/specs/commonTests' +describe.only('CommentGroup', () => { + common.isConformant(CommentGroup) + common.rendersChildren(CommentGroup) +}) diff --git a/test/specs/views/Comment/CommentMeta-test.js b/test/specs/views/Comment/CommentMeta-test.js index 612a039d61..899b28c45b 100644 --- a/test/specs/views/Comment/CommentMeta-test.js +++ b/test/specs/views/Comment/CommentMeta-test.js @@ -1 +1,6 @@ -import CommentMeta from 'src/views/CommentMeta/CommentMeta' import * as common from 'test/specs/commonTests' describe.only('CommentMeta', () => { common.isConformant(CommentMeta) common.rendersChildren(CommentMeta) }) +import CommentMeta from 'src/views/CommentMeta/CommentMeta' +import * as common from 'test/specs/commonTests' +describe.only('CommentMeta', () => { + common.isConformant(CommentMeta) + common.rendersChildren(CommentMeta) +}) diff --git a/test/specs/views/Comment/CommentText-test.js b/test/specs/views/Comment/CommentText-test.js index c30fb0eb08..47849acede 100644 --- a/test/specs/views/Comment/CommentText-test.js +++ b/test/specs/views/Comment/CommentText-test.js @@ -1 +1,6 @@ -import CommentText from 'src/views/CommentText/CommentText' import * as common from 'test/specs/commonTests' describe.only('CommentText', () => { common.isConformant(CommentText) common.rendersChildren(CommentText) }) +import CommentText from 'src/views/CommentText/CommentText' +import * as common from 'test/specs/commonTests' +describe.only('CommentText', () => { + common.isConformant(CommentText) + common.rendersChildren(CommentText) +})