Add unit test for SearchBar.textFieldHintColor on iOS

Related to #1807
This commit is contained in:
Rossen Hristov
2016-06-15 14:09:11 +03:00
parent 921d7180ca
commit 5c4dbde98c
2 changed files with 7 additions and 17 deletions

View File

@ -1,16 +1,11 @@
import colorModule = require("color"); import { SearchBar } from "ui/search-bar";
import searchBarModule = require("ui/search-bar"); import { Color } from "color";
import * as utils from "utils/utils";
export function getNativeHintColor(searchBar: searchBarModule.SearchBar): colorModule.Color { export function getNativeHintColor(searchBar: SearchBar): Color {
// TODO: This test needs to be created return (<any>searchBar)._placeholderLabel ? utils.ios.getColor((<any>searchBar)._placeholderLabel.textColor) : undefined;
return undefined;
} }
export function getNativeFontSize(searchBar: searchBarModule.SearchBar): number { export function getNativeFontSize(searchBar: SearchBar): number {
var sf = <UITextField>(<any>searchBar)._textField; return (<any>searchBar)._textField ? (<any>searchBar)._textField.font.pointSize : undefined;
if (sf) {
return sf.font.pointSize;
}
return undefined;
} }

View File

@ -28,11 +28,6 @@ export var testSearchBarHintColorAndroid = function () {
helper.buildUIAndRunTest(_createSearchBarFunc(), function (views: Array<viewModule.View>) { helper.buildUIAndRunTest(_createSearchBarFunc(), function (views: Array<viewModule.View>) {
var searchBar = <searchBarModule.SearchBar>views[0]; var searchBar = <searchBarModule.SearchBar>views[0];
// TODO: create IOS test once IOS support is working
if (!searchBar.android) {
return;
}
searchBar.text = ""; searchBar.text = "";
searchBar.hint = "hint color test"; searchBar.hint = "hint color test";