-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIMOB-25866] : iOS TiUISearchBar getter is returning value from prox…
…y not from searchbar view (#9947) * [TIMOB-225850] : iOS SearchBar doesn't show Bookmark button when set on creation in TableView * [TIMOB-25850] : iOS SearchBar doesn't show Bookmark button when set on creation in TableView * [TIMOB-25850] : Color properties set for search bar with other properties * [TIMOB-25866] : iOS TiUISearchBar getter is returning value from proxy not from searchbar view * [TIMOB-25866] : Unit test added for properties of search bar * [TIMOB-25866] : Fix linting issue
- Loading branch information
1 parent
ec56053
commit d03b8f6
Showing
2 changed files
with
195 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* global Ti */ | ||
/* eslint no-unused-expressions: "off" */ | ||
'use strict'; | ||
var should = require('./utilities/assertions'); | ||
|
||
describe('Titanium.UI.SearchBar', function () { | ||
var win; | ||
|
||
afterEach(function () { | ||
if (win) { | ||
win.close(); | ||
} | ||
win = null; | ||
}); | ||
|
||
it.ios('.showBookmark', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
showBookmark: true | ||
}); | ||
should(searchBar.getShowBookmark).be.a.Function; | ||
should(searchBar.showBookmark).be.true; | ||
should(searchBar.getShowBookmark()).be.true; | ||
searchBar.showBookmark = false; | ||
should(searchBar.showBookmark).be.false; | ||
should(searchBar.getShowBookmark()).be.fasle; | ||
}); | ||
|
||
it.ios('.keyboardType', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
keyboardType: Ti.UI.KEYBOARD_TYPE_NUMBER_PAD | ||
}); | ||
should(searchBar.getKeyboardType).be.a.Function; | ||
should(searchBar.keyboardType).eql(Ti.UI.KEYBOARD_TYPE_NUMBER_PAD); | ||
should(searchBar.getKeyboardType()).eql(Ti.UI.KEYBOARD_TYPE_NUMBER_PAD); | ||
searchBar.keyboardType = Ti.UI.KEYBOARD_TYPE_EMAIL; | ||
should(searchBar.keyboardType).eql(Ti.UI.KEYBOARD_TYPE_EMAIL); | ||
should(searchBar.getKeyboardType()).eql(Ti.UI.KEYBOARD_TYPE_EMAIL); | ||
}); | ||
|
||
it.ios('.autocorrect', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
autocorrect: true | ||
}); | ||
should(searchBar.getAutocorrect).be.a.Function; | ||
should(searchBar.autocorrect).be.true; | ||
should(searchBar.getAutocorrect()).be.true; | ||
searchBar.autocorrect = false; | ||
should(searchBar.autocorrect).be.false; | ||
should(searchBar.getAutocorrect()).be.false; | ||
}); | ||
|
||
it.ios('.autocapitalization', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_ALL | ||
}); | ||
should(searchBar.getAutocapitalization).be.a.Function; | ||
should(searchBar.autocapitalization).eql(Ti.UI.TEXT_AUTOCAPITALIZATION_ALL); | ||
should(searchBar.getAutocapitalization()).eql(Ti.UI.TEXT_AUTOCAPITALIZATION_ALL); | ||
searchBar.autocapitalization = Ti.UI.TEXT_AUTOCAPITALIZATION_SENTENCES; | ||
should(searchBar.autocapitalization).eql(Ti.UI.TEXT_AUTOCAPITALIZATION_SENTENCES); | ||
should(searchBar.getAutocapitalization()).eql(Ti.UI.TEXT_AUTOCAPITALIZATION_SENTENCES); | ||
}); | ||
|
||
it.ios('.keyboardAppearance', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
keyboardAppearance: Ti.UI.KEYBOARD_APPEARANCE_LIGHT | ||
}); | ||
should(searchBar.getKeyboardAppearance).be.a.Function; | ||
should(searchBar.keyboardAppearance).eql(Ti.UI.KEYBOARD_APPEARANCE_LIGHT); | ||
should(searchBar.getKeyboardAppearance()).eql(Ti.UI.KEYBOARD_APPEARANCE_LIGHT); | ||
searchBar.keyboardAppearance = Ti.UI.KEYBOARD_APPEARANCE_DARK; | ||
should(searchBar.keyboardAppearance).eql(Ti.UI.KEYBOARD_APPEARANCE_DARK); | ||
should(searchBar.getKeyboardAppearance()).eql(Ti.UI.KEYBOARD_APPEARANCE_DARK); | ||
}); | ||
|
||
it.ios('.style', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
style: Ti.UI.iOS.SEARCH_BAR_STYLE_PROMINENT | ||
}); | ||
should(searchBar.getStyle).be.a.Function; | ||
should(searchBar.style).eql(Ti.UI.iOS.SEARCH_BAR_STYLE_PROMINENT); | ||
should(searchBar.getStyle()).eql(Ti.UI.iOS.SEARCH_BAR_STYLE_PROMINENT); | ||
searchBar.style = Ti.UI.iOS.SEARCH_BAR_STYLE_MINIMAL; | ||
should(searchBar.style).eql(Ti.UI.iOS.SEARCH_BAR_STYLE_MINIMAL); | ||
should(searchBar.getStyle()).eql(Ti.UI.iOS.SEARCH_BAR_STYLE_MINIMAL); | ||
}); | ||
|
||
it.ios('.prompt', function () { | ||
var searchBar = Ti.UI.createSearchBar({ | ||
prompt: 'value' | ||
}); | ||
should(searchBar.getStyle).be.a.Function; | ||
should(searchBar.prompt).eql('value'); | ||
should(searchBar.getPrompt()).eql('value'); | ||
searchBar.prompt = 'another value'; | ||
should(searchBar.prompt).eql('another value'); | ||
should(searchBar.getPrompt()).eql('another value'); | ||
}); | ||
|
||
}); |