mirror of
https://github.com/wassname/talk.git
synced 2026-07-17 11:33:39 +08:00
Keep time!
This commit is contained in:
@@ -194,10 +194,10 @@ exports[`post a comment 1`] = `
|
||||
</span>
|
||||
<time
|
||||
className="Timestamp-root RelativeTime-root"
|
||||
dateTime="2018-08-31T16:14:09.617Z"
|
||||
title="2018-08-31T16:14:09.617Z"
|
||||
dateTime="2018-07-06T18:24:00.002Z"
|
||||
title="2018-07-06T18:24:00.002Z"
|
||||
>
|
||||
2018-08-31T16:14:09.617Z
|
||||
2018-07-06T18:24:00.002Z
|
||||
</time>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import TestRenderer, { ReactTestRenderer } from "react-test-renderer";
|
||||
import { RecordProxy } from "relay-runtime";
|
||||
import timekeeper from "timekeeper";
|
||||
|
||||
import { timeout } from "talk-common/utils";
|
||||
import { TalkContext, TalkContextProvider } from "talk-framework/lib/bootstrap";
|
||||
@@ -94,11 +95,13 @@ it("post a comment", async () => {
|
||||
.findByProps({ inputId: "comments-postCommentForm-field" })
|
||||
.props.onChange({ html: "<strong>Hello world!</strong>" });
|
||||
|
||||
timekeeper.travel(new Date("2018-07-06T18:24:00.000Z"));
|
||||
testRenderer.root
|
||||
.findByProps({ id: "comments-postCommentForm-form" })
|
||||
.props.onSubmit();
|
||||
// Test optimistic response.
|
||||
expect(testRenderer.toJSON()).toMatchSnapshot();
|
||||
timekeeper.reset();
|
||||
|
||||
// Wait for loading.
|
||||
await timeout();
|
||||
|
||||
Reference in New Issue
Block a user