test: use baseComment and baseAsset in fixtures

This commit is contained in:
Chi Vinh Le
2018-09-27 17:48:10 +02:00
parent 3ffdb09afe
commit ccb6f347ae
11 changed files with 191 additions and 275 deletions
@@ -315,10 +315,10 @@ exports[`cancel edit: edit canceled 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -754,10 +754,10 @@ exports[`edit a comment: edit form 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1193,10 +1193,10 @@ exports[`edit a comment: optimistic response 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1568,10 +1568,10 @@ exports[`edit a comment: render stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1952,10 +1952,10 @@ exports[`edit a comment: server response 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -2327,10 +2327,10 @@ exports[`shows expiry message: edit form closed 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -2743,10 +2743,10 @@ exports[`shows expiry message: edit time expired 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -245,10 +245,10 @@ exports[`loads more comments 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -315,10 +315,10 @@ exports[`loads more comments 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:14:00.000Z"
title="2018-07-06T18:14:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:14:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -605,10 +605,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -394,10 +394,10 @@ exports[`post a comment: optimistic response 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -838,10 +838,10 @@ exports[`post a comment: server response 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1197,10 +1197,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -426,10 +426,10 @@ exports[`post a reply: open reply form 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1013,10 +1013,10 @@ exports[`post a reply: optimistic response 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1463,10 +1463,10 @@ exports[`post a reply: server response 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -1822,10 +1822,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -393,10 +393,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:14:00.000Z"
title="2018-07-06T18:14:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:14:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -463,10 +463,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:14:00.000Z"
title="2018-07-06T18:14:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:14:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -535,10 +535,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:14:00.000Z"
title="2018-07-06T18:14:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:14:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -245,10 +245,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -249,10 +249,10 @@ exports[`renders comment stream 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -569,10 +569,10 @@ exports[`show all replies 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:20:00.000Z"
title="2018-07-06T18:20:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:20:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -639,10 +639,10 @@ exports[`show all replies 1`] = `
>
<time
className="Timestamp-root RelativeTime-root"
dateTime="2018-07-06T18:14:00.000Z"
title="2018-07-06T18:14:00.000Z"
dateTime="2018-07-06T18:24:00.000Z"
title="2018-07-06T18:24:00.000Z"
>
2018-07-06T18:14:00.000Z
2018-07-06T18:24:00.000Z
</time>
</div>
</div>
@@ -5,7 +5,7 @@ import timekeeper from "timekeeper";
import { timeout } from "talk-common/utils";
import { createSinonStub } from "talk-framework/testHelpers";
import { assets, settings, users } from "../fixtures";
import { assets, baseComment, settings, users } from "../fixtures";
import create from "./create";
let testRenderer: ReactTestRenderer;
@@ -39,20 +39,10 @@ beforeEach(() => {
edge: {
cursor: null,
node: {
...baseComment,
id: "comment-x",
author: users[0],
body: "<strong>Hello world! (from server)</strong>",
createdAt: "2018-07-06T18:24:00.000Z",
editing: {
edited: false,
editableUntil: "2018-07-06T18:24:30.000Z",
},
replies: { edges: [], pageInfo: {} },
actionCounts: {
reaction: {
total: 0,
},
},
},
},
clientMutationId: "0",
@@ -84,7 +74,7 @@ it("post a comment", async () => {
.findByProps({ inputId: "comments-postCommentForm-field" })
.props.onChange({ html: "<strong>Hello world!</strong>" });
timekeeper.freeze(new Date("2018-07-06T18:24:00.000Z"));
timekeeper.freeze(new Date(baseComment.createdAt));
testRenderer.root
.findByProps({ id: "comments-postCommentForm-form" })
@@ -5,7 +5,12 @@ import timekeeper from "timekeeper";
import { timeout } from "talk-common/utils";
import { createSinonStub } from "talk-framework/testHelpers";
import { assetWithDeepestReplies, settings, users } from "../fixtures";
import {
assetWithDeepestReplies,
baseComment,
settings,
users,
} from "../fixtures";
import create from "./create";
let testRenderer: ReactTestRenderer;
@@ -39,23 +44,10 @@ beforeEach(() => {
edge: {
cursor: null,
node: {
...baseComment,
id: "comment-x",
author: users[0],
body: "<strong>Hello world! (from server)</strong>",
createdAt: "2018-07-06T18:24:00.000Z",
replies: {
edges: [],
pageInfo: { endCursor: null, hasNextPage: false },
},
editing: {
edited: false,
editableUntil: "2018-07-06T18:24:30.000Z",
},
actionCounts: {
reaction: {
total: 0,
},
},
},
},
clientMutationId: "0",
@@ -102,7 +94,7 @@ it("post a reply", async () => {
})
.props.onChange({ html: "<strong>Hello world!</strong>" });
timekeeper.freeze(new Date("2018-07-06T18:24:00.000Z"));
timekeeper.freeze(new Date(baseComment.createdAt));
testRenderer.root
.findByProps({
id: "comments-replyCommentForm-form-comment-with-deepest-replies-5",
@@ -5,7 +5,7 @@ import timekeeper from "timekeeper";
import { timeout } from "talk-common/utils";
import { createSinonStub } from "talk-framework/testHelpers";
import { assets, settings, users } from "../fixtures";
import { assets, baseComment, settings, users } from "../fixtures";
import create from "./create";
let testRenderer: ReactTestRenderer;
@@ -39,23 +39,10 @@ beforeEach(() => {
edge: {
cursor: null,
node: {
...baseComment,
id: "comment-x",
author: users[0],
body: "<strong>Hello world! (from server)</strong>",
createdAt: "2018-07-06T18:24:00.000Z",
replies: {
edges: [],
pageInfo: { endCursor: null, hasNextPage: false },
},
editing: {
edited: false,
editableUntil: "2018-07-06T18:24:30.000Z",
},
actionCounts: {
reaction: {
total: 0,
},
},
},
},
clientMutationId: "0",
@@ -97,7 +84,7 @@ it("post a reply", async () => {
.findByProps({ inputId: "comments-replyCommentForm-rte-comment-0" })
.props.onChange({ html: "<strong>Hello world!</strong>" });
timekeeper.freeze(new Date("2018-07-06T18:24:00.000Z"));
timekeeper.freeze(new Date(baseComment.createdAt));
testRenderer.root
.findByProps({ id: "comments-replyCommentForm-form-comment-0" })
.props.onSubmit();