Skip to content

Commit

Permalink
fixing stream test
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Mar 17, 2023
1 parent 3a44d0b commit 575a790
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,10 @@ var testThread = []slack.Message{
},
}

func Test_channelStream_thread(t *testing.T) {
lim := limits(&DefOptions.Limits)

func Test_processThreadMessages(t *testing.T) {
t.Run("all files from messages are collected", func(t *testing.T) {
ctrl := gomock.NewController(t)
mc := NewmockClienter(ctrl)

mc.EXPECT().
GetConversationRepliesContext(gomock.Any(), gomock.Any()).Return(testThread, false, "", nil)

cs := &Stream{
client: mc,
limits: lim,
}
mproc := mock_processor.NewMockConversations(ctrl)
mproc.EXPECT().
ThreadMessages(gomock.Any(), "CTM1", testThread[0], testThread[1:]).
Expand All @@ -190,7 +180,7 @@ func Test_channelStream_thread(t *testing.T) {
Files(gomock.Any(), "CTM1", testThread[2], true, testThread[2].Files).
Return(nil)

if err := cs.thread(context.Background(), "CTM1", testThread[0].ThreadTimestamp, mproc); err != nil {
if err := processThreadMessages(context.Background(), mproc, "CTM1", testThread[0].ThreadTimestamp, testThread); err != nil {
t.Fatal(err)
}
})
Expand Down

0 comments on commit 575a790

Please sign in to comment.