Index: ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm |
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm b/ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c2409fa6e9666f689b443b57640ac7a99fdef66f |
--- /dev/null |
+++ b/ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm |
@@ -0,0 +1,30 @@ |
+// 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/authentication/signin_promo_view.h" |
+ |
+#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" |
+#include "third_party/ocmock/gtest_support.h" |
+ |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
+TEST(SigninPromoViewTest, ChangeProfileImageInColdState) { |
+ SigninPromoView* view = |
+ [[SigninPromoView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; |
+ view.mode = SigninPromoViewColdStateMode; |
+ UIImage* chromeImage = view.imageView.image; |
+ [view setProfileImage:[[UIImage alloc] init]]; |
+ EXPECT_EQ(chromeImage, view.imageView.image); |
+} |
+ |
+TEST(SigninPromoViewTest, SecondaryButtonVisibility) { |
+ SigninPromoView* view = |
+ [[SigninPromoView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; |
+ view.mode = SigninPromoViewColdStateMode; |
+ EXPECT_TRUE(view.secondaryButton.hidden); |
+ view.mode = SigninPromoViewWarmStateMode; |
+ EXPECT_FALSE(view.secondaryButton.hidden); |
+} |