it('maps a field to a single ID', () => {
   const fatQuery = fromGraphQL.Fragment(Relay.QL`
     fragment on FeedbackLikeResponsePayload {
       feedback {
         doesViewerLike,
         likers,
       }
     }
   `);
   tracker.getTrackedChildrenForID.mockReturnValue(getNodeChildren(Relay.QL`
     fragment on Feedback {
       likers,
       url
     }
   `));
   const node = RelayMutationQuery.buildFragmentForFields({
     fatQuery,
     tracker,
     fieldIDs: {
       feedback: '123',
     },
   });
   const expected = getNodeWithoutSource(Relay.QL`
     fragment on FeedbackLikeResponsePayload {
       feedback {
         likers
       }
     }
   `);
   expect(node)
     .toEqualQueryNode(expected);
   expect(tracker.getTrackedChildrenForID.mock.calls).toEqual([
     ['123'],
   ]);
 });
 expect(() => {
   RelayMutationQuery.buildFragmentForFields({
     fatQuery,
     tracker,
     fieldIDs: {
       unsubscribee: '4',
     },
   });
 }).toFailInvariant(
 it('maps a plural field to an array of IDs', () => {
   const fatQuery = fromGraphQL.Fragment(Relay.QL`
     fragment on ViewerNotificationsUpdateAllSeenStateResponsePayload {
       stories {
         seenState
       }
     }
   `);
   tracker.getTrackedChildrenForID.mockReturnValue(getNodeChildren(Relay.QL`
     fragment on Story {
       message {
         text
       },
       seenState
     }
   `));
   const node = RelayMutationQuery.buildFragmentForFields({
     fatQuery,
     tracker,
     fieldIDs: {
       stories: ['123'],
     },
   });
   const expected = getNodeWithoutSource(Relay.QL`
     fragment on ViewerNotificationsUpdateAllSeenStateResponsePayload {
       stories {
         seenState
       }
     }
   `);
   expect(node)
     .toEqualQueryNode(expected);
   expect(tracker.getTrackedChildrenForID.mock.calls).toEqual([
     ['123'],
   ]);
 });
 it('merges tracked nodes for IDs of plural fields', () => {
   const fatQuery = fromGraphQL.Fragment(Relay.QL`
     fragment on ViewerNotificationsUpdateAllSeenStateResponsePayload {
       stories {
         seenState
       }
     }
   `);
   const trackedNodes = {
     '123': fromGraphQL.Fragment(Relay.QL`
       fragment on Story {
         message {
           text
         }
       }
     `),
     '456': fromGraphQL.Fragment(Relay.QL`
       fragment on Story {
         actors {
           name
         },
         seenState
       }
     `),
   };
   tracker.getTrackedChildrenForID.mockImplementation(
     dataID => [trackedNodes[dataID]]
   );
   RelayMutationQuery.buildFragmentForFields({
     fatQuery,
     tracker,
     fieldIDs: {
       stories: ['123', '456'],
     },
   });
   const node = intersectRelayQuery.mock.calls[0][0];
   const expected = RelayTestUtils.getVerbatimNode(Relay.QL`
     fragment on Story {
       ... on Story {
         id,
         message {
           text
         },
       },
       ... on Story {
         id,
         actors {
           __typename,
           id,
           name
         },
         seenState
       }
     }
   `);
   // Clone because the root node will differ, but that's okay.
   expect(expected.clone(node.getChildren()))
     .toEqualQueryNode(expected);
   expect(tracker.getTrackedChildrenForID.mock.calls).toEqual([
     ['123'],
     ['456'],
   ]);
 });