Merge branch 'next' into pym-storage

This commit is contained in:
Chi Vinh Le
2018-09-05 23:27:59 +02:00
62 changed files with 2231 additions and 420 deletions
@@ -33,7 +33,8 @@ beforeEach(() => {
},
})
.returns({
commentEdge: {
// TODO: add a type assertion here to ensure that if the type changes, that the test will fail
edge: {
cursor: "2018-07-06T18:24:00.000Z",
node: {
id: "comment-x",
@@ -72,15 +73,19 @@ it("post a comment", async () => {
.props.onChange({ html: "<strong>Hello world!</strong>" });
timekeeper.freeze(new Date("2018-07-06T18:24:00.000Z"));
testRenderer.root
.findByProps({ id: "comments-postCommentForm-form" })
.props.onSubmit();
timekeeper.reset();
// Test optimistic response.
expect(testRenderer.toJSON()).toMatchSnapshot();
timekeeper.reset();
// Wait for loading.
await timeout();
// Test after server response.
expect(testRenderer.toJSON()).toMatchSnapshot();
});