Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NT-485] Tracking event for Update Pledge #920

Merged
merged 10 commits into from
Oct 31, 2019
Merged

Conversation

cdolm92
Copy link
Contributor

@cdolm92 cdolm92 commented Oct 31, 2019

πŸ“² What

Improvements in monitoring user behavior for v1 checkout. This tracks updated pledges.

πŸ€” Why

We now have the Update Pledge Button Clicked event.

βœ… Acceptance criteria

Note: Update Pledge Event should not trigger when changing a payment method

  • Navigate to a live and backed project. Go to the manage menu and tap Update Pledge. Change your pledge amount and tap Confirm, you should see the "Update Pledge Button Clicked" triggered.
  • Navigate to a live and backed project. Go to the manage menu and tap Update Pledge. Change your shipping location and tap Confirm, you should see the "Update Pledge Button Clicked" triggered.
  • Navigate to a live and backed project. Go to the manage menu and tap Choose another reward. Change your reward and tap Select, then tap Confirm, you should see the "Update Pledge Button Clicked" triggered.

Copy link
Contributor Author

@cdolm92 cdolm92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review w/ @Scollaco

@@ -96,6 +96,7 @@ public class PledgeViewModel: PledgeViewModelType, PledgeViewModelInputs, Pledge
let context = initialData.map { $0.3 }

let backing = project.map { $0.personalization.backing }.skipNil()
let projectAndBacking = Signal.combineLatest(project, backing)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need to use this anymore

|> Backing.lens.status .~ .pledged
|> Backing.lens.shippingAmount .~ 10
|> Backing.lens.amount .~ 700
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove this and just use the template.

state: .successful,
backing: .init(
clientSecret: "client-secret",
requiresAction: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to default this to false b/c we're not testing SCA flow.

updateBackingResult: .success(updateBackingEnvelope)
)

withEnvironment(apiService: mockService, currentUser: .template) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing environment call and adding an additional test to test .updateReward context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added an additional test to make sure the tracking event is not triggered in changePaymentMethod context.

@@ -3427,4 +3427,44 @@ final class PledgeViewModelTests: TestCase {
self.showErrorBannerWithMessage.assertDidNotEmitValue()
}
}

func testTrackingEvents() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to testTrackingEvents_ContextIsUpdate()

Copy link
Contributor

@Scollaco Scollaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏌

@cdolm92 cdolm92 merged commit e3ef2fe into master Oct 31, 2019
@cdolm92 cdolm92 deleted the update-pledge-event branch October 31, 2019 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants