Skip to content

Commit

Permalink
Add batch push tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Dec 31, 2024
1 parent 709052f commit 182bce6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,35 @@ func TestCiphertext(t *testing.T) {
})
}

func TestBatchPush(t *testing.T) {
Endpoint(t, []APITestCase{
{
Name: "Batch Push",
Method: "POST",
URL: "/" + key,
Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\":[\"" + key + "\",\"" + key + "\",\"" + key + "\"]}",
IsJson: true,
WantStatusCode: 200,
},
{
Name: "Batch Push",
Method: "POST",
URL: "/push",
Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\":[\"" + key + "\",\"" + key + "\",\"" + key + "\"]}",
IsJson: true,
WantStatusCode: 200,
},
{
Name: "Batch Push",
Method: "POST",
URL: "/push",
Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\": \"" + key + "," + key + "," + key + "\"}",
IsJson: true,
WantStatusCode: 200,
},
})
}

type APITestCase struct {
Name string
Method string
Expand Down

0 comments on commit 182bce6

Please sign in to comment.