Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Web/Slack/Conversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ data ChannelConversation = ChannelConversation
-- ^ Absent from @users.conversations@ response
, channelTopic :: Topic
, channelPurpose :: Purpose
, channelPreviousNames :: [Text]
, channelPreviousNames :: Maybe [Text]
, channelNumMembers :: Maybe Integer
-- ^ Absent from @conversations.join@ response
}
Expand Down
1 change: 1 addition & 0 deletions tests/Web/Slack/ConversationSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ spec = describe "ToJSON and FromJSON for Conversation" $ do

describe "Golden tests" $ do
mapM_ (oneGoldenTestDecode @Conversation) ["shared_channel"]
mapM_ (oneGoldenTestDecode @Conversation) ["no_previous_names"]
mapM_ (oneGoldenTestDecode @InfoRsp) ["general"]
mapM_ (oneGoldenTestDecode @JoinRsp) ["test"]
mapM_ (oneGoldenTestDecode @MembersRsp) ["test"]
Expand Down
32 changes: 32 additions & 0 deletions tests/golden/Conversation/no_previous_names.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Channel
( ChannelConversation
{ channelId = ConversationId
{ unConversationId = "C0000000000" }
, channelName = "shared-channel"
, channelCreated = 1667519517
, channelIsArchived = False
, channelIsGeneral = False
, channelUnlinked = 0
, channelNameNormalized = "shared-channel"
, channelIsShared = True
, channelCreator = UserId
{ unUserId = "UAAAAAAAA" }
, channelIsExtShared = True
, channelIsOrgShared = False
, channelSharedTeamIds = Nothing
, channelIsPendingExtShared = False
, channelIsMember = Just False
, channelTopic = Topic
{ topicValue = ""
, topicCreator = ""
, topicLastSet = 0
}
, channelPurpose = Purpose
{ purposeValue = ""
, purposeCreator = ""
, purposeLastSet = 0
}
, channelPreviousNames = Nothing
, channelNumMembers = Just 12
}
)
36 changes: 36 additions & 0 deletions tests/golden/Conversation/no_previous_names.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"id": "C0000000000",
"name": "shared-channel",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_private": false,
"created": 1667519517,
"is_archived": false,
"is_general": false,
"unlinked": 0,
"name_normalized": "shared-channel",
"is_shared": true,
"is_org_shared": false,
"is_pending_ext_shared": false,
"pending_shared": [],
"context_team_id": "TAAAAAAAA",
"parent_conversation": null,
"creator": "UAAAAAAAA",
"is_ext_shared": true,
"pending_connected_team_ids": [],
"conversation_host_id": "TAAAAAAAA",
"is_member": false,
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
},
"num_members": 12
}
4 changes: 2 additions & 2 deletions tests/golden/Conversation/shared_channel.golden
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Channel
, purposeCreator = ""
, purposeLastSet = 0
}
, channelPreviousNames = []
, channelPreviousNames = Just []
, channelNumMembers = Just 12
}
)
)
4 changes: 2 additions & 2 deletions tests/golden/InfoRsp/general.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ InfoRsp
, purposeCreator = "U043H11ES4V"
, purposeLastSet = 1663890553
}
, channelPreviousNames = []
, channelPreviousNames = Just []
, channelNumMembers = Nothing
}
)
}
}
4 changes: 2 additions & 2 deletions tests/golden/JoinRsp/test.golden
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ JoinRsp
, purposeCreator = ""
, purposeLastSet = 0
}
, channelPreviousNames = []
, channelPreviousNames = Just []
, channelNumMembers = Nothing
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ UsersConversationsResponse
, purposeCreator = "U043H11ES4V"
, purposeLastSet = 1663890553
}
, channelPreviousNames = []
, channelPreviousNames = Just []
, channelNumMembers = Nothing
}
)
Expand Down Expand Up @@ -66,7 +66,7 @@ UsersConversationsResponse
, purposeCreator = ""
, purposeLastSet = 0
}
, channelPreviousNames = []
, channelPreviousNames = Just []
, channelNumMembers = Nothing
}
)
Expand Down Expand Up @@ -105,4 +105,4 @@ UsersConversationsResponse
)
}
)
}
}
Loading