Skip to content

Commit

Permalink
addressing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aydrian committed Mar 8, 2021
1 parent fdf9bdd commit 36faa7c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 52 deletions.
8 changes: 1 addition & 7 deletions internal/events/types/streamdown/streamdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,14 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
},
Event: models.StreamDownEventSubEvent{
BroadcasterUserID: params.ToUserID,
BroadcasterUserLogin: params.ToUserID,
BroadcasterUserLogin: params.ToUserName,
BroadcasterUserName: params.ToUserName,
},
}
event, err = json.Marshal(body)
if err != nil {
return events.MockEventResponse{}, err
}
case models.TransportWebSub:
body := models.FollowWebSubResponse{} // replace with actual model in internal/models
event, err = json.Marshal(body)
if err != nil {
return events.MockEventResponse{}, err
}
default:
return events.MockEventResponse{}, nil
}
Expand Down
19 changes: 0 additions & 19 deletions internal/events/types/streamdown/streamdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,6 @@ func TestEventSub(t *testing.T) {
// write actual tests here (making sure you set appropriate values and the like) for eventsub
}

func TestWebSub(t *testing.T) {
a := util.SetupTestEnv(t)

params := *&events.MockEventParameters{
FromUserID: fromUser,
ToUserID: toUser,
Transport: models.TransportWebSub,
Trigger: "unsubscribe",
}

r, err := Event{}.GenerateEvent(params)
a.Nil(err)

var body models.SubWebSubResponse // replace with actual value
err = json.Unmarshal(r.JSON, &body)
a.Nil(err)

// write tests here for websub
}
func TestFakeTransport(t *testing.T) {
a := util.SetupTestEnv(t)

Expand Down
8 changes: 1 addition & 7 deletions internal/events/types/streamup/streamup.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
Event: models.StreamUpEventSubEvent{
ID: util.RandomUserID(),
BroadcasterUserID: params.ToUserID,
BroadcasterUserLogin: params.ToUserID,
BroadcasterUserLogin: params.ToUserName,
BroadcasterUserName: params.ToUserName,
Type: "live",
StartedAt: util.GetTimestamp().Format(time.RFC3339Nano),
Expand All @@ -63,12 +63,6 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
if err != nil {
return events.MockEventResponse{}, err
}
case models.TransportWebSub:
body := models.FollowWebSubResponse{} // replace with actual model in internal/models
event, err = json.Marshal(body)
if err != nil {
return events.MockEventResponse{}, err
}
default:
return events.MockEventResponse{}, nil
}
Expand Down
19 changes: 0 additions & 19 deletions internal/events/types/streamup/streamup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,6 @@ func TestEventSub(t *testing.T) {
// write actual tests here (making sure you set appropriate values and the like) for eventsub
}

func TestWebSub(t *testing.T) {
a := util.SetupTestEnv(t)

params := *&events.MockEventParameters{
FromUserID: fromUser,
ToUserID: toUser,
Transport: models.TransportWebSub,
Trigger: "unsubscribe",
}

r, err := Event{}.GenerateEvent(params)
a.Nil(err)

var body models.SubWebSubResponse // replace with actual value
err = json.Unmarshal(r.JSON, &body)
a.Nil(err)

// write tests here for websub
}
func TestFakeTransport(t *testing.T) {
a := util.SetupTestEnv(t)

Expand Down

0 comments on commit 36faa7c

Please sign in to comment.