Skip to content

Commit f59266d

Browse files
committed
Add test debug statements
1 parent a795a96 commit f59266d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

channel.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"errors"
77
"io"
8+
"log"
89
"net/http"
910
"net/url"
1011
"path"
@@ -724,7 +725,9 @@ func MarkUnreadThread(id string) func(*markUnreadOption) {
724725
}
725726

726727
func MarkUnreadFromTimestamp(timestamp time.Time) func(*markUnreadOption) {
728+
log.Println("Got timestamp", timestamp)
727729
return func(opt *markUnreadOption) {
730+
log.Println("Mark unread option func called", opt)
728731
opt.MessageTimestamp = timestamp
729732
}
730733
}
@@ -740,13 +743,16 @@ func (ch *Channel) MarkUnread(ctx context.Context, userID string, options ...Mar
740743
opts := &markUnreadOption{
741744
UserID: userID,
742745
}
743-
744-
for _, fn := range options {
746+
log.Println("Length of options: ", len(options))
747+
for i, fn := range options {
748+
log.Println("Calling option number", i)
745749
fn(opts)
746750
}
747751

748752
var resp Response
753+
log.Println("Making request", opts)
749754
err := ch.client.makeRequest(ctx, http.MethodPost, p, nil, opts, &resp)
755+
log.Println("Got response", resp, err)
750756
return &resp, err
751757
}
752758

channel_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ func TestChannel_MarkUnread(t *testing.T) {
10281028

10291029
t.Run("successful mark unread with timestamp", func(t *testing.T) {
10301030
timestamp := time.Now().Add(-1 * time.Hour)
1031+
log.Println("Timestamp", timestamp)
10311032
resp, err := ch.MarkUnread(ctx, user1.ID, MarkUnreadFromTimestamp(timestamp))
10321033
require.NoError(t, err, "mark unread with timestamp should not return an error")
10331034
require.NotNil(t, resp, "response should not be nil")

0 commit comments

Comments
 (0)