-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MBL-1838: Wire up PLOT query to UI in no-shipping checkout flow #2225
Conversation
@@ -625,3 +626,20 @@ private func distinctRewards(_ rewards: [Reward]) -> [Reward] { | |||
return !rewardIds.contains(reward.id) | |||
} | |||
} | |||
|
|||
// TODO: Remove this when implementing the API [MBL-1851](https://kickstarter.atlassian.net/browse/MBL-1851) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this and changed the ticket number. It's no longer needed in NoShippingPledgeViewModel
, but still needed here in ManagePledgeViewModel
.
).materialize() | ||
} | ||
|
||
self.showPledgeOverTimeUI = Signal.merge( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jovaniks My assumption is that, since this feature is so small, there's no designs for a separate error state. Is that correct? My approach was just to hide the entire element if an error occurs in the BuildPaymentPlan
query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s correct, we don’t have error handling planned for this component at the moment. Do you think it would make sense to add a TODO
to revisit this discussion once everyone is back in January
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll set myself a reminder in Slack for January! And I'll raise it in the next PLOT meeting.
@@ -5285,4 +5287,97 @@ final class NoShippingPledgeViewModelTests: TestCase { | |||
self.showPledgeOverTimeUI.assertValues([false]) | |||
} | |||
} | |||
|
|||
func testPledgeOverTimeConfigData_LoadsAfterBuildPledgeQuery() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are pretty bare-bones. I'd love to test that the mock query is actually making a GraphQL request for the right amount, but I don't think we have that capability with our current mock infrastructure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
re: the loading state, the decision was made to block pledging until PLOT UI loads, or fails due to some error. If there's an error we'll just default to a normal (non-plot) pledge.
@@ -393,3 +405,51 @@ final class NoShippingPledgeViewControllerTests: TestCase { | |||
} | |||
} | |||
} | |||
|
|||
private let buildPaymentPlanQueryJson_Eligible = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of note: if we upgrade Apollo, we'll get access to their mocks API. Then it will be really, really easy to mock GraphQL response objects in our tests without all of this verbose json nonsense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
8cf1850
to
26a74d9
Compare
📲 What
Hook up the
BuildPaymentPlanQuery
to the new PLOT UI.🤔 Why
This means PLOT will start showing live data, instead of mock data.
🛠 How
PledgePaymentIncrement
fragment.👀 See
PLOT.demo.small.mp4
📓 Todos