-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathmisc_test.go
More file actions
32 lines (25 loc) · 849 Bytes
/
misc_test.go
File metadata and controls
32 lines (25 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package buildkite
import (
"context"
"fmt"
"net/http"
"testing"
"github.com/google/go-cmp/cmp"
)
func TestListEmojis(t *testing.T) {
t.Parallel()
server, client, teardown := newMockServerAndClient(t)
t.Cleanup(teardown)
server.HandleFunc("/v2/organizations/my-great-org/emojis", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
_, _ = fmt.Fprint(w, `[{"name":"rocket","url":"https://a.buildboxassets.com/assets/emoji2/unicode/1f680.png?v2"}]`)
})
emoji, _, err := client.ListEmojis(context.Background(), "my-great-org")
if err != nil {
t.Errorf("ListEmojis returned error: %v", err)
}
want := []Emoji{{Name: "rocket", URL: "https://a.buildboxassets.com/assets/emoji2/unicode/1f680.png?v2"}}
if diff := cmp.Diff(emoji, want); diff != "" {
t.Errorf("ListEmojis diff: (-got +want): \n%s", diff)
}
}