Skip to content

Commit 63f4b79

Browse files
test: refine update contact test to include email field in payload
1 parent 4a7d388 commit 63f4b79

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/__tests__/lib/mailtrap-client.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,15 +774,14 @@ describe("lib/mailtrap-client: ", () => {
774774
mock.onPatch(endpoint).reply(200, expectedResponseData);
775775

776776
const updateData = {
777+
email: "john.smith@example.com",
777778
fields: { first_name: "Johnny", last_name: "Smith" },
778779
};
779780

780781
const result = await client.contacts.update(contactId, updateData);
781782

782783
expect(mock.history.patch[0].url).toEqual(endpoint);
783-
expect(mock.history.patch[0].data).toEqual(
784-
JSON.stringify({ contact: updateData })
785-
);
784+
expect(mock.history.patch[0].data).toEqual(JSON.stringify({ contact: updateData }));
786785
expect(result).toEqual(expectedResponseData);
787786
});
788787

0 commit comments

Comments
 (0)