diff --git a/src/core/client/stream/components/Comment.spec.tsx b/src/core/client/stream/components/Comment.spec.tsx new file mode 100644 index 000000000..6008bfc3b --- /dev/null +++ b/src/core/client/stream/components/Comment.spec.tsx @@ -0,0 +1,28 @@ +import React from "react"; +import { createRenderer } from "react-test-renderer/shallow"; +import Comment from "./Comment"; + +it("renders username and body", () => { + const props = { + author: { + username: "Marvin", + }, + body: "Woof", + }; + const renderer = createRenderer(); + renderer.render(); + expect(renderer.getRenderOutput()).toMatchSnapshot(); +}); + +it("renders with gutterBottom", () => { + const props = { + author: { + username: "Marvin", + }, + body: "Woof", + gutterBottom: true, + }; + const renderer = createRenderer(); + renderer.render(); + expect(renderer.getRenderOutput()).toMatchSnapshot(); +}); diff --git a/src/core/client/stream/components/__snapshots__/Comment.spec.tsx.snap b/src/core/client/stream/components/__snapshots__/Comment.spec.tsx.snap new file mode 100644 index 000000000..4b009e257 --- /dev/null +++ b/src/core/client/stream/components/__snapshots__/Comment.spec.tsx.snap @@ -0,0 +1,33 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders username and body 1`] = ` +
+ + Marvin + + + Woof + +
+`; + +exports[`renders with gutterBottom 1`] = ` +
+ + Marvin + + + Woof + +
+`; diff --git a/src/core/client/tsconfig.json b/src/core/client/tsconfig.json index ffb2142b6..a62cea6c5 100644 --- a/src/core/client/tsconfig.json +++ b/src/core/client/tsconfig.json @@ -5,40 +5,16 @@ "module": "esnext", "jsx": "preserve", "allowJs": false, - "lib": [ - "dom", - "es7", - "scripthost", - "es2015", - "esnext.asynciterable" - ], + "lib": ["dom", "es7", "scripthost", "es2015", "esnext.asynciterable"], "baseUrl": "./", "paths": { - "talk-admin/*": [ - "./admin/*" - ], - "talk-stream/*": [ - "./stream/*" - ], - "talk-framework/*": [ - "./framework/*" - ], - "talk-ui/*": [ - "./ui/*" - ], - "talk-common/*": [ - "../common/*" - ], - "talk-locales/*": [ - "../../locales/*" - ] + "talk-admin/*": ["./admin/*"], + "talk-stream/*": ["./stream/*"], + "talk-framework/*": ["./framework/*"], + "talk-ui/*": ["./ui/*"], + "talk-common/*": ["../common/*"] } }, - "include": [ - "./**/*", - "../../types/**/*.d.ts" - ], - "exclude": [ - "node_modules" - ] -} \ No newline at end of file + "include": ["./**/*", "../../types/**/*.d.ts"], + "exclude": ["node_modules"] +} diff --git a/src/tsconfig.json b/src/tsconfig.json index eddf98d29..857892f4d 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -9,26 +9,13 @@ "outDir": "../dist", // See https://github.com/prismagraphql/graphql-request/issues/26 for why we // have to include "dom" here. - "lib": [ - "es6", - "esnext.asynciterable", - "dom" - ], + "lib": ["es6", "esnext.asynciterable", "dom"], "baseUrl": "./", "paths": { - "talk-server/*": [ - "./core/server/*" - ], - "talk-common/*": [ - "./core/common/*" - ] + "talk-server/*": ["./core/server/*"], + "talk-common/*": ["./core/common/*"] } }, - "include": [ - "./**/*" - ], - "exclude": [ - "node_modules", - "./core/client" - ] -} \ No newline at end of file + "include": ["./**/*"], + "exclude": ["node_modules", "./core/client"] +}