+ cd /testbed
+ git config --global --add safe.directory /testbed
+ cd /testbed
+ git checkout 1afcc6abc9e3e772d27086374d0a1b6e5a733a67 client/state/posts/test/actions.js client/state/ui/editor/test/edit-save-flow.js
Updated 0 paths from 54d3606d09
+ git apply --verbose --reject -
Checking patch client/state/posts/test/actions.js...
Checking patch client/state/ui/editor/test/edit-save-flow.js...
Applied patch client/state/posts/test/actions.js cleanly.
Applied patch client/state/ui/editor/test/edit-save-flow.js cleanly.
+ : '>>>>> Start Test Output'
+ ./node_modules/.bin/jest --verbose -c=test/client/jest.config.json client/state/posts/test/actions.js
FAIL client/state/posts/test/actions.js (6.777s)
  actions
    #receivePost()
      ✓ should return an action object (3ms)
    #receivePosts()
      ✓ should return an action object
    savePostSuccess()
      ✕ should return an action object (41ms)
    #requestSitePosts()
      ✓ should dispatch fetch action when thunk triggered (14ms)
      ✓ should dispatch posts receive action when request completes (23ms)
      ✓ should dispatch success action when posts request completes (2ms)
      ✓ should dispatch posts request success action with query results (3ms)
      ✓ should dispatch failure action when request fails (6ms)
    #requestAllSitesPosts()
      ✓ should dispatch posts receive action when request completes (2ms)
    #requestSitePost()
      ✓ should dispatch request action when thunk triggered (1ms)
      ✓ should dispatch posts receive action when request completes (2ms)
      ✓ should dispatch posts posts request success action when request completes
      ✓ should dispatch fail action when request fails (1ms)
    #editPost()
      ✓ should return an action object for a new post (1ms)
      ✓ should return an action object for an existing post
    savePost()
      ✓ should dispatch save action when thunk triggered for new post (3ms)
      ✕ should dispatch success action when saving new post succeeds (7ms)
      ✓ should dispatch received post action when saving new post succeeds (1ms)
      ✓ should dispatch save action when thunk triggered for existing post (1ms)
      ✕ should dispatch success action when saving existing post succeeds (2ms)
      ✓ should dispatch received post action when saving existing post succeeds (1ms)
      ✓ should dispatch failure action when saving new post fails (5ms)
      ✓ should dispatch failure action when saving existing post fails (3ms)
    trashPost()
      ✓ should dispatch save request with trash status payload (2ms)
    deletePost()
      ✓ should dispatch request action when thunk triggered (1ms)
      ✓ should dispatch success action when deleting post succeeds (3ms)
      ✓ should dispatch failure action when deleting post fails (1ms)
    restorePost()
      ✓ should dispatch request action when thunk triggered (1ms)
      ✓ should dispatch the received post when request completes successfully (1ms)
      ✓ should dispatch success action when restoring post succeeds (1ms)
      ✓ should dispatch failure action when restoring post fails (1ms)
    addTermForPost()
      ✓ should dispatch a POST_EDIT event with the new term (1ms)
      ✓ should not dispatch anything if no post
      ✓ should not dispatch anything if no term
      ✓ should not dispatch anything if the term is temporary
    #updateMetadata()
      ✓ should dispatch a post edit with a new metadata value (1ms)
      ✓ accepts an object of key value pairs
    #deleteMetadata()
      ✓ should dispatch a post edit with a deleted metadata (1ms)
      ✓ should accept an array of metadata keys to delete

  ● actions › savePostSuccess() › should return an action object

    AssertionError: expected { Object (type, siteId, ...) } to deeply equal { Object (type, siteId, ...) }

      84 | 			const action = savePostSuccess( 10, 841, savedPost, attributes );
      85 | 
    > 86 | 			expect( action ).to.eql( {
         | 			                    ^
      87 | 				type: POST_SAVE_SUCCESS,
      88 | 				siteId: 10,
      89 | 				postId: 841,

      at Object.<anonymous> (client/state/posts/test/actions.js:86:24)

  ● actions › savePost() › should dispatch success action when saving new post succeeds

    AssertionError: expected spy to have been called with arguments {
      post: { title: "Hello World" },
      postId: null,
      savedPost: match(ID: 13640, title: Hello World),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    }
    Call 1:
    { post: { title: "Hello World" }, postId: null, siteId: 2916284, type: "POST_SAVE" } {
      post: { title: "Hello World" },
      postId: null,
      savedPost: match(ID: 13640, title: Hello World),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    } 
    Call 2:
    {
      post: { title: "Hello World" },
      postId: null,
      saveMarker: null,
      savedPost: { ID: 13640, title: "Hello World" },
      savedPost: match(ID: 13640, title: Hello World),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    }
    Call 3:
    { posts: [{ ID: 13640, title: "Hello World" }], type: "POSTS_RECEIVE" } {
      post: { title: "Hello World" },
      postId: null,
      savedPost: match(ID: 13640, title: Hello World),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    } 
    Call 4:
    {
      post: { title: "Hello World" },
      postId: null,
      saveMarker: null,
      savedPost: { ID: 13640, title: "Hello World" },
      savedPost: match(ID: 13640, title: Hello World),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    }
    Call 5:
    { posts: [{ ID: 13640, title: "Hello World" }], type: "POSTS_RECEIVE" } {
      post: { title: "Hello World" },
      postId: null,
      savedPost: match(ID: 13640, title: Hello World),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    } 

      324 | 		test( 'should dispatch success action when saving new post succeeds', () => {
      325 | 			return savePost( 2916284, null, { title: 'Hello World' } )( spy ).then( () => {
    > 326 | 				expect( spy ).to.have.been.calledWith( {
          | 				                           ^
      327 | 					type: POST_SAVE_SUCCESS,
      328 | 					siteId: 2916284,
      329 | 					postId: null,

      at client/state/posts/test/actions.js:326:32

  ● actions › savePost() › should dispatch success action when saving existing post succeeds

    AssertionError: expected spy to have been called with arguments {
      post: { title: "Updated" },
      postId: 13640,
      savedPost: match(ID: 13640, title: Updated),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    }
    Call 1:
    { post: { title: "Updated" }, postId: 13640, siteId: 2916284, type: "POST_SAVE" } {
      post: { title: "Updated" },
      postId: 13640,
      savedPost: match(ID: 13640, title: Updated),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    } 
    Call 2:
    {
      post: { title: "Updated" },
      postId: 13640,
      saveMarker: null,
      savedPost: { ID: 13640, title: "Updated" },
      savedPost: match(ID: 13640, title: Updated),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    }
    Call 3:
    { posts: [{ ID: 13640, title: "Updated" }], type: "POSTS_RECEIVE" } {
      post: { title: "Updated" },
      postId: 13640,
      savedPost: match(ID: 13640, title: Updated),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    } 
    Call 4:
    {
      post: { title: "Updated" },
      postId: 13640,
      saveMarker: null,
      savedPost: { ID: 13640, title: "Updated" },
      savedPost: match(ID: 13640, title: Updated),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    }
    Call 5:
    { posts: [{ ID: 13640, title: "Updated" }], type: "POSTS_RECEIVE" } {
      post: { title: "Updated" },
      postId: 13640,
      savedPost: match(ID: 13640, title: Updated),
      siteId: 2916284,
      type: "POST_SAVE_SUCCESS"
    } 

      366 | 		test( 'should dispatch success action when saving existing post succeeds', () => {
      367 | 			return savePost( 2916284, 13640, { title: 'Updated' } )( spy ).then( () => {
    > 368 | 				expect( spy ).to.have.been.calledWith( {
          | 				                           ^
      369 | 					type: POST_SAVE_SUCCESS,
      370 | 					siteId: 2916284,
      371 | 					postId: 13640,

      at client/state/posts/test/actions.js:368:32

Test Suites: 1 failed, 1 total
Tests:       3 failed, 36 passed, 39 total
Snapshots:   0 total
Time:        6.855s
Ran all test suites matching /client\/state\/posts\/test\/actions.js/i.
+ ./node_modules/.bin/jest --verbose -c=test/client/jest.config.json client/state/ui/editor/test/edit-save-flow.js
FAIL client/state/ui/editor/test/edit-save-flow.js
  ✓ create new post and save when server returns identical content (36ms)
  ✓ create new post and save when server transforms the content (6ms)
  ✓ create post, save, type while saving, verify that edits are not lost (9ms)
  ✕ create new post and save, verify that edited post is always valid (43ms)

  ● create new post and save, verify that edited post is always valid

    expect(received).not.toBeNull()

    Received: null

      241 | 		const postId = getEditorPostId( state );
      242 | 		const post = getEditedPost( state, siteId, postId );
    > 243 | 		expect( post ).not.toBeNull();
          | 		                   ^
      244 | 	} );
      245 | 
      246 | 	// edit title and content

      at client/state/ui/editor/test/edit-save-flow.js:243:22
      at dispatch (node_modules/redux/lib/redux.js:227:7)
      at node_modules/redux-thunk/lib/index.js:14:16
      at dispatch (node_modules/redux/lib/redux.js:569:28)
      at _callee$ (client/state/posts/actions.js:733:2)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:5:24)
      at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 3 passed, 4 total
Snapshots:   0 total
Time:        4.206s
Ran all test suites matching /client\/state\/ui\/editor\/test\/edit-save-flow.js/i.
+ : '>>>>> End Test Output'
+ git checkout 1afcc6abc9e3e772d27086374d0a1b6e5a733a67 client/state/posts/test/actions.js client/state/ui/editor/test/edit-save-flow.js
Updated 2 paths from 54d3606d09
