| 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..09b6fde5ee08009bb7fc48e58e2d41a3ee79c3cc
|
| --- /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 = SigninPromoViewModeColdState;
|
| + 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 = SigninPromoViewModeColdState;
|
| + EXPECT_TRUE(view.secondaryButton.hidden);
|
| + view.mode = SigninPromoViewModeWarmState;
|
| + EXPECT_FALSE(view.secondaryButton.hidden);
|
| +}
|
|
|