diff --git a/src/core/client/stream/components/App.css b/src/core/client/stream/components/App.css index 9836a4fcf..2bcabb67f 100644 --- a/src/core/client/stream/components/App.css +++ b/src/core/client/stream/components/App.css @@ -1,8 +1,8 @@ /* Here we add global stylings for body and document */ :global { body { - margin: "0"; - padding: 2px; + margin: 0; + padding: 2px 8px; /* Support for all WebKit browsers. */ -webkit-font-smoothing: antialiased; diff --git a/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap b/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap index 9253404bd..6c5348d0b 100644 --- a/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap +++ b/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap @@ -1,21 +1,25 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders correctly on big screens 1`] = ` -
-
- Hello World +
+
+
+ Hello World +
`; exports[`renders correctly on small screens 1`] = ` -
-
- Hello World +
+
+
+ Hello World +
`; diff --git a/src/core/client/stream/components/UserBox.css b/src/core/client/stream/components/UserBoxUnauthenticated.css similarity index 100% rename from src/core/client/stream/components/UserBox.css rename to src/core/client/stream/components/UserBoxUnauthenticated.css diff --git a/src/core/client/stream/components/UserBoxUnauthenticated.spec.tsx b/src/core/client/stream/components/UserBoxUnauthenticated.spec.tsx new file mode 100644 index 000000000..f9683c1e8 --- /dev/null +++ b/src/core/client/stream/components/UserBoxUnauthenticated.spec.tsx @@ -0,0 +1,16 @@ +import { shallow } from "enzyme"; +import { noop } from "lodash"; +import React from "react"; + +import { PropTypesOf } from "talk-framework/types"; + +import UserBoxUnauthenticated from "./UserBoxUnauthenticated"; + +it("renders correctly", () => { + const props: PropTypesOf = { + onSignIn: noop, + onRegister: noop, + }; + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); +}); diff --git a/src/core/client/stream/components/UserBox.tsx b/src/core/client/stream/components/UserBoxUnauthenticated.tsx similarity index 75% rename from src/core/client/stream/components/UserBox.tsx rename to src/core/client/stream/components/UserBoxUnauthenticated.tsx index cff9dcb0a..d16792c7a 100644 --- a/src/core/client/stream/components/UserBox.tsx +++ b/src/core/client/stream/components/UserBoxUnauthenticated.tsx @@ -2,14 +2,16 @@ import React, { StatelessComponent } from "react"; import { Button, Flex, Typography } from "talk-ui/components"; -import * as styles from "./UserBox.css"; +import * as styles from "./UserBoxUnauthenticated.css"; -export interface UserBoxProps { +export interface UserBoxUnauthenticatedProps { onSignIn: () => void; onRegister: () => void; } -const UserBox: StatelessComponent = props => { +const UserBoxUnauthenticated: StatelessComponent< + UserBoxUnauthenticatedProps +> = props => { return ( = props => { ); }; -export default UserBox; +export default UserBoxUnauthenticated; diff --git a/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap b/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap new file mode 100644 index 000000000..f814d5234 --- /dev/null +++ b/src/core/client/stream/components/__snapshots__/UserBoxUnauthenticated.spec.tsx.snap @@ -0,0 +1,34 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders correctly 1`] = ` + + + Join the conversation + + + | + + + Sign In + + + Register + + +`; diff --git a/src/core/client/stream/containers/UserBoxContainer.spec.tsx b/src/core/client/stream/containers/UserBoxContainer.spec.tsx new file mode 100644 index 000000000..122b4e987 --- /dev/null +++ b/src/core/client/stream/containers/UserBoxContainer.spec.tsx @@ -0,0 +1,24 @@ +import { shallow } from "enzyme"; +import React from "react"; + +import { PropTypesOf } from "talk-framework/types"; + +import { UserBoxContainer } from "./UserBoxContainer"; + +it("renders correctly", () => { + const props: PropTypesOf = { + local: { + authPopup: { + open: false, + focus: false, + view: "SIGN_IN", + }, + }, + // tslint:disable-next-line:no-empty + showAuthPopup: async () => {}, + // tslint:disable-next-line:no-empty + setAuthPopupState: async () => {}, + }; + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); +}); diff --git a/src/core/client/stream/containers/UserBoxContainer.tsx b/src/core/client/stream/containers/UserBoxContainer.tsx index 2e780fd61..359c93d97 100644 --- a/src/core/client/stream/containers/UserBoxContainer.tsx +++ b/src/core/client/stream/containers/UserBoxContainer.tsx @@ -11,7 +11,7 @@ import { } from "talk-stream/mutations"; import { Popup } from "talk-ui/components"; -import UserBox from "../components/UserBox"; +import UserBoxUnauthenticated from "../components/UserBoxUnauthenticated"; interface InnerProps { local: Local; @@ -19,7 +19,7 @@ interface InnerProps { setAuthPopupState: SetAuthPopupStateMutation; } -class UserBoxContainer extends Component { +export class UserBoxContainer extends Component { private handleFocus = () => this.props.setAuthPopupState({ focus: true }); private handleBlur = () => this.props.setAuthPopupState({ focus: false }); private handleClose = () => this.props.setAuthPopupState({ open: false }); @@ -44,7 +44,7 @@ class UserBoxContainer extends Component { onBlur={this.handleBlur} onClose={this.handleClose} /> - diff --git a/src/core/client/stream/containers/__snapshots__/UserBoxContainer.spec.tsx.snap b/src/core/client/stream/containers/__snapshots__/UserBoxContainer.spec.tsx.snap new file mode 100644 index 000000000..c1fdd3d4c --- /dev/null +++ b/src/core/client/stream/containers/__snapshots__/UserBoxContainer.spec.tsx.snap @@ -0,0 +1,20 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders correctly 1`] = ` + + + + +`; diff --git a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap index 95be74360..0f533f921 100644 --- a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap +++ b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap @@ -1,180 +1,200 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`loads more comments 1`] = ` -
+
-
- - Join the conversation - - - | - - - -
-
-
-