Skip to content

Commit

Permalink
Fix up handle snapshot errors tests (#4801)
Browse files Browse the repository at this point in the history
Summary:
I'm not sure how this got in a bad state. Maybe a land race/bad merge?

Pull Request resolved: #4801

Reviewed By: gordyf

Differential Revision: D63132096

Pulled By: captbaritone

fbshipit-source-id: 556101f15ab52da534be701fca6e5380c9b02b81
  • Loading branch information
captbaritone authored and facebook-github-bot committed Sep 20, 2024
1 parent 575f206 commit 66fc7a0
Showing 1 changed file with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,24 +373,26 @@ describe('handlePotentialSnapshotErrors', () => {
/^Relay: Unexpected response payload - this object includes an errors property in which you can access the underlying errors/,
);

expect(relayFieldLogger).toHaveBeenCalledTimes(2);
expect(relayFieldLogger).toHaveBeenCalledWith({
error: {
message: 'testMessage',
path: ['testPath'],
severity: 'CRITICAL',
},
fieldPath: 'testPath',
kind: 'relay_field_payload.error',
owner: 'testOwner',
shouldThrow: true,
});
const eventsLogged = relayFieldLogger.mock.calls.map(call => call[0]);

expect(relayFieldLogger).toHaveBeenCalledWith({
fieldPath: '',
kind: 'missing_expected_data.throw',
owner: '',
});
expect(eventsLogged).toEqual([
{
error: {
message: 'testMessage',
path: ['testPath'],
severity: 'CRITICAL',
},
fieldPath: 'testPath',
kind: 'relay_field_payload.error',
owner: 'testOwner',
shouldThrow: true,
},
{
fieldPath: '',
kind: 'missing_expected_data.log',
owner: 'RelayModernStoreSubscriptionsTest1Fragment',
},
]);
});
});

Expand Down

0 comments on commit 66fc7a0

Please sign in to comment.