mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #1263 from NativeScript/issue-518
Fixed Issue #518: Allow ActionItems to be directly specified between…
This commit is contained in:
15
apps/tests/ui/action-bar/ActionBar_BetweenTags.xml
Normal file
15
apps/tests/ui/action-bar/ActionBar_BetweenTags.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<Page>
|
||||
<Page.actionBar>
|
||||
<ActionBar>
|
||||
<ActionItem text="i1" tap="onTapped"/>
|
||||
<Label text="tv" tap="onTapped"/>
|
||||
<ActionItem text="i2" tap="onTapped"/>
|
||||
<NavigationButton text="nb" tap="onTapped"/>
|
||||
<ActionItem text="i3" tap="onTapped"/>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
|
||||
<StackLayout>
|
||||
<Label text="page content"/>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
@@ -324,6 +324,28 @@ export function test_Setting_ActionItemsWithNumberAsText_doesnt_thrown() {
|
||||
}
|
||||
}
|
||||
|
||||
export function test_CanDefineEverythingAsContentBetweenTheTwoTags() {
|
||||
var moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length);
|
||||
helper.navigateToModuleAndRunTest(moduleName + "/ActionBar_BetweenTags", undefined, (page: PageModule.Page) => {
|
||||
|
||||
TKUnit.assertNotNull(page.actionBar.navigationButton);
|
||||
TKUnit.assertEqual(page.actionBar.navigationButton.text, "nb");
|
||||
|
||||
TKUnit.assertNull(page.actionBar.title);
|
||||
TKUnit.assertNotNull(page.actionBar.titleView);
|
||||
TKUnit.assertTrue(page.actionBar.titleView instanceof LabelModule.Label);
|
||||
TKUnit.assertEqual((<LabelModule.Label>page.actionBar.titleView).text, "tv");
|
||||
|
||||
TKUnit.assertNotNull(page.actionBar.actionItems);
|
||||
var items = page.actionBar.actionItems.getItems();
|
||||
TKUnit.assertEqual(items.length, 3);
|
||||
|
||||
TKUnit.assertEqual(items[0].text, "i1");
|
||||
TKUnit.assertEqual(items[1].text, "i2");
|
||||
TKUnit.assertEqual(items[2].text, "i3");
|
||||
});
|
||||
}
|
||||
|
||||
export function createPageAndNavigate() {
|
||||
var page: PageModule.Page;
|
||||
var pageFactory = function (): PageModule.Page {
|
||||
|
||||
Reference in New Issue
Block a user