Skip to content

Commit

Permalink
update integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Dec 21, 2024
1 parent bcaf8b0 commit 76ff180
Showing 1 changed file with 34 additions and 22 deletions.
56 changes: 34 additions & 22 deletions tests/integration/conversations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ describe("Conversations", () => {
// act
const response = await client.conversations.reply({
conversation_id: conversationId,
message_type: "comment",
type: "admin",
body: "test",
admin_id: adminId,
body: {
message_type: "comment",
type: "admin",
body: "test",
admin_id: adminId,
}
});

// assert
Expand All @@ -132,10 +134,12 @@ describe("Conversations", () => {
// act
const response = await client.conversations.reply({
conversation_id: conversationId,
message_type: "comment",
type: "user",
body: "*click* Nice!",
intercom_user_id: user.id,
body: {
message_type: "comment",
type: "user",
body: "*click* Nice!",
intercom_user_id: user.id,
}
});

// assert
Expand All @@ -149,11 +153,13 @@ describe("Conversations", () => {
// act
const response = await client.conversations.manage({
conversation_id: message.conversation_id,
message_type: "assignment",
type: "admin",
admin_id: adminId,
assignee_id: secondAdminId,
body: "Goodbye :)",
body: {
message_type: "assignment",
type: "admin",
admin_id: adminId,
assignee_id: secondAdminId,
body: "Goodbye :)",
}
});

// assert
Expand All @@ -177,9 +183,11 @@ describe("Conversations", () => {
// act
const response = await client.conversations.manage({
conversation_id: conversationId,
message_type: "snoozed",
admin_id: adminId,
snoozed_until: new Date("2040.06.19").getTime() / 1000,
body: {
message_type: "snoozed",
admin_id: adminId,
snoozed_until: new Date("2040.06.19").getTime() / 1000,
}
});

// assert
Expand All @@ -190,8 +198,10 @@ describe("Conversations", () => {
// act
const response = await client.conversations.manage({
conversation_id: conversationId,
message_type: "open",
admin_id: adminId,
body: {
message_type: "open",
admin_id: adminId,
}
});

// assert
Expand Down Expand Up @@ -243,10 +253,12 @@ describe("Conversations", () => {
// act
const response = await client.conversations.manage({
conversation_id: conversationId,
type: "admin",
message_type: "close",
admin_id: adminId,
body: "Hasta la vista, baby",
body: {
type: "admin",
message_type: "close",
admin_id: adminId,
body: "Hasta la vista, baby",
}
});

// assert
Expand Down

0 comments on commit 76ff180

Please sign in to comment.