Skip to content

Commit

Permalink
Fix subscriptions tests
Browse files Browse the repository at this point in the history
deactivated assertion expected value updated to ptr, since the field was changed to be a *bool.

Updated record type subscribed to in tests from "PaymentSubmission" to "payment_submissions". This snake_case resource name is what's used in newer cloud-agnostic stacks. Since that is now the majority of stacks deployed, I've updated it to the new style.
  • Loading branch information
joshkeegan-form3 committed Nov 21, 2024
1 parent c0825df commit 4fa8fec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/form3/subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestCreateSubscriptionsDeprecatedCallbackUriParams(t *testing.T) {
transport := models.CallbackTransportHTTP
callbackURI := "https://webhook.site/db28eac0-d0a5-4078-b9be-0e4617471b01"
eventType := "created"
recordType := "PaymentSubmission"
recordType := "payment_submissions"

testCreateAndUpdateSubscriptions(t, &models.SubscriptionAttributes{
CallbackTransport: transport,
Expand All @@ -31,7 +31,7 @@ func TestCreateSubscriptionsNewCallbackUriParams(t *testing.T) {
transport := models.CallbackTransportHTTP
callbackURI := "https://webhook.site/db28eac0-d0a5-4078-b9be-0e4617471b01"
eventType := "created"
recordType := "PaymentSubmission"
recordType := "payment_submissions"

testCreateAndUpdateSubscriptions(t, &models.SubscriptionAttributes{
CallbackUris: []*models.CallbackURI{{
Expand All @@ -48,7 +48,7 @@ func TestCreateSubscriptionsNewCallbackUriParamsHttpAwsPrivate(t *testing.T) {
transport := models.CallbackTransportHTTPAwsPrivate
callbackURI := "https://webhook.site/db28eac0-d0a5-4078-b9be-0e4617471b01"
eventType := "created"
recordType := "PaymentSubmission"
recordType := "payment_submissions"

testCreateAndUpdateSubscriptions(t, &models.SubscriptionAttributes{
CallbackUris: []*models.CallbackURI{{
Expand Down Expand Up @@ -98,7 +98,7 @@ func testCreateAndUpdateSubscriptions(t *testing.T, attributes *models.Subscript
updateResp, err := updateReq.Do()
require.NoError(t, err)
assert.Equal(t, id.String(), updateResp.Data.ID.String())
assert.Equal(t, true, updateResp.Data.Attributes.Deactivated)
assert.Equal(t, &deactivated, updateResp.Data.Attributes.Deactivated)

//delete
_, err = f3.Subscriptions.DeleteSubscription().WithID(id).WithVersion(version + 1).Do()
Expand Down

0 comments on commit 4fa8fec

Please sign in to comment.