diff --git a/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap index 145f4be33..69d6009dd 100644 --- a/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap +++ b/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap @@ -49,6 +49,296 @@ exports[`post a comment 1`] = ` +
+
+
+ +
+
+
+ + + +
+
Hello world!", + } + } + id="comments-postCommentForm-field" + onBlur={[Function]} + onChange={[Function]} + onCut={[Function]} + onFocus={[Function]} + onInput={[Function]} + onKeyDown={[Function]} + onPaste={[Function]} + onSelect={[Function]} + /> +
+
+
+
+
+ + Powered by + + ⁨The Coral Project⁩ + + +
+ +
+
+ +
+
+
+
+
+ + Markus + + +
+
Hello world!", + } + } + /> +
+
+
+
+
+
+ + Markus + + +
+
+
+
+
+
+
+
+ + Lukas + + +
+
+
+
+
+
+
+
+`; + +exports[`post a comment 2`] = ` +
+
+
+
+
+
+ Signed in as + + Markus + + . +
+
+ + Not you?  + + +
+
+
Hello world", + "__html": "Hello world! (from server)", } } /> diff --git a/src/core/client/stream/test/postComment.spec.tsx b/src/core/client/stream/test/postComment.spec.tsx index 0546901db..670609d89 100644 --- a/src/core/client/stream/test/postComment.spec.tsx +++ b/src/core/client/stream/test/postComment.spec.tsx @@ -46,7 +46,7 @@ beforeEach(() => { node: { id: "comment-x", author: users[0], - body: "Hello world", + body: "Hello world! (from server)", createdAt: "2018-07-06T18:24:00.000Z", }, }, @@ -97,8 +97,11 @@ it("post a comment", async () => { testRenderer.root .findByProps({ id: "comments-postCommentForm-form" }) .props.onSubmit(); + // Test optimistic response. + expect(testRenderer.toJSON()).toMatchSnapshot(); // Wait for loading. await timeout(); + // Test after server response. expect(testRenderer.toJSON()).toMatchSnapshot(); });