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

Unified Diff: ios/chrome/browser/ui/suggestions/suggestions_item_unittest.mm

Issue 2625693002: Suggestions UI - expandable item (Closed)
Patch Set: Address comments Created 3 years, 11 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/ui/suggestions/suggestions_item_unittest.mm
diff --git a/ios/chrome/browser/ui/suggestions/suggestions_item_unittest.mm b/ios/chrome/browser/ui/suggestions/suggestions_item_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..d5ae0f853c00983401b6db1f7a2aa76db00223a9
--- /dev/null
+++ b/ios/chrome/browser/ui/suggestions/suggestions_item_unittest.mm
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/suggestions/suggestions_item.h"
+
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+// Tests that configureCell: set all the fields of the cell.
+TEST(SuggestionsItemTest, CellIsConfigured) {
+ NSString* title = @"testTitle";
+ NSString* subtitle = @"testSubtitle";
+ SuggestionsItem* item =
+ [[SuggestionsItem alloc] initWithType:0 title:title subtitle:subtitle];
+ SuggestionsCell* cell = [[[item cellClass] alloc] init];
+ EXPECT_TRUE([cell isMemberOfClass:[SuggestionsCell class]]);
+
+ [item configureCell:cell];
+ EXPECT_EQ(title, [cell.titleButton titleForState:UIControlStateNormal]);
+ EXPECT_EQ(subtitle, cell.detailTextLabel.text);
+}
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698