Skip to content

Commit 49125e3

Browse files
authored
Change push-type tests for better coverage (#144)
1 parent 88a36b9 commit 49125e3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

client_test.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,14 @@ func TestHeaders(t *testing.T) {
171171
n.Topic = "com.testapp"
172172
n.Priority = 10
173173
n.Expiration = time.Now()
174+
n.PushType = apns.PushTypeBackground
174175
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
175176
assert.Equal(t, n.ApnsID, r.Header.Get("apns-id"))
176177
assert.Equal(t, n.CollapseID, r.Header.Get("apns-collapse-id"))
177178
assert.Equal(t, "10", r.Header.Get("apns-priority"))
178179
assert.Equal(t, n.Topic, r.Header.Get("apns-topic"))
179180
assert.Equal(t, fmt.Sprintf("%v", n.Expiration.Unix()), r.Header.Get("apns-expiration"))
180-
if n.PushType == "" {
181-
assert.Equal(t, "alert", r.Header.Get("apns-push-type"))
182-
} else {
183-
assert.Equal(t, n.PushType, r.Header.Get("apns-push-type"))
184-
}
181+
assert.Equal(t, "background", r.Header.Get("apns-push-type"))
185182
}))
186183
defer server.Close()
187184
_, err := mockClient(server.URL).Push(n)

0 commit comments

Comments
 (0)