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

View File

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