blob: af56d539f7a456eb05b7d812becd4d6d6e1c33c5 [file] [log] [blame]
// Copyright 2016 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/settings/cells/passphrase_error_item.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace {
using PassphraseErrorItemTest = PlatformTest;
// Tests that the text label is set properly after a call to |configureCell:|.
TEST_F(PassphraseErrorItemTest, ConfigureCell) {
PassphraseErrorItem* item = [[PassphraseErrorItem alloc] initWithType:0];
PassphraseErrorCell* cell = [[[item cellClass] alloc] init];
EXPECT_TRUE([cell isMemberOfClass:[PassphraseErrorCell class]]);
EXPECT_NSEQ(nil, cell.textLabel.text);
NSString* text = @"This is an error";
item.text = text;
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_NSEQ(text, cell.textLabel.text);
}
} // namespace