Skip to content

Commit 5f78f5d

Browse files
committed
remove features field from client
1 parent 998ac14 commit 5f78f5d

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

conversation/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ func (lro *PaginationRequest) QueryParams() string {
5353
// request does the exact same thing as Client.Request. It does, however,
5454
// prefix the path with the Conversation API's root. This ensures the client
5555
// doesn't "handle" this for us: by default, it uses the REST API.
56-
func request(c *messagebird.Client, v interface{}, method, path string, data interface{}) error {
56+
func request(c messagebird.MessageBirdClient, v interface{}, method, path string, data interface{}) error {
5757
return c.Request(v, method, fmt.Sprintf("%s/%s", apiRoot, path), data)
5858
}

conversation/api_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package conversation
22

33
import (
4-
messagebird "github.com/messagebird/go-rest-api/v8"
54
"github.com/messagebird/go-rest-api/v8/internal/mbtest"
65
"github.com/stretchr/testify/assert"
76
"net/http"
@@ -18,21 +17,6 @@ func TestRequestSandboxEnabled(t *testing.T) {
1817
reqPath := "qwerty"
1918

2019
client := mbtest.MockClient().(*mbtest.ClientMock)
21-
client.On("IsFeatureEnabled", messagebird.FeatureConversationsAPIWhatsAppSandbox).Return(true)
22-
client.On("Request", data, method, whatsappSandboxAPIRoot+"/"+reqPath, data).Return(nil)
23-
24-
err := request(client, data, method, reqPath, data)
25-
26-
assert.NoError(t, err)
27-
}
28-
29-
func TestRequestSandboxDisabled(t *testing.T) {
30-
data := struct{}{}
31-
method := http.MethodGet
32-
reqPath := "qwerty"
33-
34-
client := mbtest.MockClient().(*mbtest.ClientMock)
35-
client.On("IsFeatureEnabled", messagebird.FeatureConversationsAPIWhatsAppSandbox).Return(false)
3620
client.On("Request", data, method, apiRoot+"/"+reqPath, data).Return(nil)
3721

3822
err := request(client, data, method, reqPath, data)

0 commit comments

Comments
 (0)