@@ -28,7 +28,7 @@ export function test_recycling() {
2828 helper . nativeView_recycling_test ( ( ) => new searchBarModule . SearchBar ( ) ) ;
2929}
3030
31- export var testSearchBarHintColorAndroid = function ( ) {
31+ export var testSearchBarHintColor = function ( ) {
3232 helper . buildUIAndRunTest ( _createSearchBarFunc ( ) , function ( views : Array < viewModule . View > ) {
3333 var searchBar = < searchBarModule . SearchBar > views [ 0 ] ;
3434
@@ -50,6 +50,28 @@ export var testSearchBarHintColorAndroid = function () {
5050 } ) ;
5151} ;
5252
53+ export var testSearchBarTextFieldBackgroundColor = function ( ) {
54+ helper . buildUIAndRunTest ( _createSearchBarFunc ( ) , function ( views : Array < viewModule . View > ) {
55+ var searchBar = < searchBarModule . SearchBar > views [ 0 ] ;
56+
57+ searchBar . text = "" ;
58+ searchBar . hint = "" ;
59+
60+ var expectedNormalizedValue ;
61+ var actualValue ;
62+
63+ searchBar . textFieldBackgroundColor = new colorModule . Color ( "blue" ) ;
64+ expectedNormalizedValue = "#0000FF" ; // blue
65+ actualValue = searchBarTestsNative . getNativeTextFieldBackgroundColor ( searchBar ) . hex ;
66+ TKUnit . assert ( actualValue === expectedNormalizedValue , "Actual: " + actualValue + "; Expected: " + expectedNormalizedValue ) ;
67+
68+ searchBar . textFieldBackgroundColor = new colorModule . Color ( "red" ) ;
69+ expectedNormalizedValue = "#FF0000" ; // red
70+ actualValue = searchBarTestsNative . getNativeTextFieldBackgroundColor ( searchBar ) . hex ;
71+ TKUnit . assert ( actualValue === expectedNormalizedValue , "Actual: " + actualValue + "; Expected: " + expectedNormalizedValue ) ;
72+ } ) ;
73+ } ;
74+
5375export var testSearchBarFontSize = function ( ) {
5476 helper . buildUIAndRunTest ( _createSearchBarFunc ( ) , function ( views : Array < viewModule . View > ) {
5577 var searchBar = < searchBarModule . SearchBar > views [ 0 ] ;
@@ -66,6 +88,32 @@ export var testSearchBarFontSize = function () {
6688 } ) ;
6789} ;
6890
91+ export var testSearchBarPropertiesWithCSS = function ( ) {
92+ helper . buildUIAndRunTest ( _createSearchBarFunc ( ) , function ( views : Array < viewModule . View > ) {
93+ var searchBar = < searchBarModule . SearchBar > views [ 0 ] ;
94+
95+ const expectedHintColor = "#0000FF" ; // blue
96+ const expectedTextFieldBackgroundColor = "#FF0000" ; // red
97+ const expectedFontSize = 30 ;
98+
99+ const hintColorActualValue = searchBarTestsNative . getNativeHintColor ( searchBar ) . hex ;
100+ const textFieldBackgroundColorActualValue = searchBarTestsNative . getNativeTextFieldBackgroundColor ( searchBar ) . hex ;
101+ const fontSizeActualValue = searchBarTestsNative . getNativeFontSize ( searchBar ) ;
102+
103+ TKUnit . assert ( hintColorActualValue === expectedHintColor , "HintColor - Actual: " + hintColorActualValue + "; Expected: " + expectedHintColor ) ;
104+ TKUnit . assert ( expectedTextFieldBackgroundColor === textFieldBackgroundColorActualValue , "Text Background Color - Actual: " + textFieldBackgroundColorActualValue + "; Expected: " + expectedTextFieldBackgroundColor ) ;
105+ TKUnit . assertAreClose ( expectedFontSize , fontSizeActualValue , 0.2 , "Font Size - Actual: " + fontSizeActualValue + "; Expected: " + expectedFontSize ) ;
106+ } , { pageCss : `
107+ SearchBar {
108+ text: test;
109+ hint: test;
110+ text-field-hint-color: blue;
111+ text-field-background-color: red;
112+ font-size: 30;
113+ }
114+ ` } ) ;
115+ } ;
116+
69117export function test_DummyTestForSnippetOnly ( ) {
70118 // >> article-searching
71119 var searchBar = new searchBarModule . SearchBar ( ) ;
0 commit comments