Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Unified Diff: ios/chrome/browser/payments/payment_request_view_controller_unittest.mm

Issue 2710683012: [Payment Request] Payment request summary view pending state (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/payments/payment_request_view_controller_unittest.mm
diff --git a/ios/chrome/browser/payments/payment_request_view_controller_unittest.mm b/ios/chrome/browser/payments/payment_request_view_controller_unittest.mm
index 490e4d3184d7feb5134e7a4ddc04bcb2b54de5b2..fdc5d9bc5da4f22511dc77826612a8a8d19a12ff 100644
--- a/ios/chrome/browser/payments/payment_request_view_controller_unittest.mm
+++ b/ios/chrome/browser/payments/payment_request_view_controller_unittest.mm
@@ -181,3 +181,21 @@ TEST_F(PaymentRequestViewControllerTest, TestModelNoSelectedPaymentMethod) {
CollectionViewDetailItem* detail_item = item;
EXPECT_EQ(MDCCollectionViewCellAccessoryNone, detail_item.accessoryType);
}
+
+// Tests that the correct items are displayed after loading the model, when
+// the view is in pending state.
+TEST_F(PaymentRequestViewControllerTest, TestModelPendingState) {
+ CreateController();
+ CheckController();
+
+ [GetPaymentRequestViewController() setPending:YES];
+ [GetPaymentRequestViewController() loadModel];
+
+ ASSERT_EQ(1, NumberOfSections());
+ // There should be only one item.
+ ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0)));
+
+ // The item should be of type StatusItem.
+ id item = GetCollectionViewItem(0, 0);
+ EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]);
+}

Powered by Google App Engine
This is Rietveld 408576698