Fix tests app paths

This commit is contained in:
Erjan Gavalji
2015-03-24 16:05:54 +02:00
parent cb25cfc64d
commit d5af4c4723
20 changed files with 33 additions and 33 deletions

View File

@ -1,3 +1,3 @@
import application = require("application");
application.mainModule = "app/app/mainPage";
application.mainModule = "app/mainPage";
application.start();

View File

@ -212,7 +212,7 @@ function testTemplate(candidates: Array<string>, context: resolver.PlatformConte
TKUnit.assertEqual(result, expected, "File path");
}
var testFilePath = fs.path.join(fs.knownFolders.currentApp().path, "app/tests/file-name-resolver-tests/files/test");
var testFilePath = fs.path.join(fs.knownFolders.currentApp().path, "tests/file-name-resolver-tests/files/test");
export function test_file_resolver_with_andorid_phone_portratit() {
var fileResolver = new resolver.FileNameResolver(androidPhonePortraitContext);
@ -242,4 +242,4 @@ export function test_file_resolver_with_ios_phone_portrait() {
var fileResolver = new resolver.FileNameResolver(iPhonePortraitContext);
var result = fileResolver.resolveFileName(testFilePath, "xml");
TKUnit.assertEqual(result, testFilePath + ".xml", "File path");
}
}

View File

@ -13,7 +13,7 @@ export var test_DummyTestForSnippetOnly0 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating to a Module
// ``` JavaScript
topmost.navigate("app/details-page");
topmost.navigate("details-page");
// ```
// </snippet>
}
@ -39,7 +39,7 @@ export var test_DummyTestForSnippetOnly2 = function () {
// ### Navigating with NavigationEntry
// ``` JavaScript
var navigationEntry = {
moduleName: "app/details-page",
moduleName: "details-page",
context: { info: "something you want to pass to your page" },
animated: false
};
@ -55,4 +55,4 @@ export var test_DummyTestForSnippetOnly3 = function () {
topmost.goBack();
// ```
// </snippet>
}
}

View File

@ -1,2 +1,2 @@
{ "name" : "Tests",
"main" : "testRunner.js" }
"main" : "app/app.js" }

View File

@ -1,3 +1,3 @@
import application = require("application");
application.mainModule = "app/pages/page14";
application.mainModule = "pages/page14";
application.start();

View File

@ -7,7 +7,7 @@ export function createPage() {
var page = new pages.Page();
var lbl = new label.Label();
var moduleName = "app/tests/pages/files/test";
var moduleName = "tests/pages/files/test";
var resolver = new fileResolverModule.FileNameResolver({
width: 400,

View File

@ -11,7 +11,7 @@ export function createPage() {
var btn = new button.Button();
btn.text = "Page B new activity";
btn.on(button.knownEvents.tap, function () {
var nextPage = "app/tests/pages/navigation/pageB-new-activity";
var nextPage = "tests/pages/navigation/pageB-new-activity";
frame.topmost().navigate(nextPage);
});
stack.addChild(btn);

View File

@ -17,7 +17,7 @@ export function createPage() {
var btn = new button.Button();
btn.text = "Page B";
btn.on(button.knownEvents.tap, function () {
var nextPage = "app/tests/pages/navigation/pageB";
var nextPage = "tests/pages/navigation/pageB";
frame.topmost().navigate(nextPage);
});
stack.addChild(btn);
@ -25,7 +25,7 @@ export function createPage() {
var btnActivity = new button.Button();
btnActivity.text = "start activity";
btnActivity.on(button.knownEvents.tap, function () {
var newPage = "app/tests/pages/navigation/pageA-new-activity";
var newPage = "tests/pages/navigation/pageA-new-activity";
var newFrame = new frame.Frame();
newFrame.navigate(newPage);
@ -55,4 +55,4 @@ export function createPage() {
page.content = stack;
return page;
}
}

View File

@ -11,7 +11,7 @@ export function createPage() {
var btn = new button.Button();
btn.text = "Page C new activity";
btn.on(button.knownEvents.tap, function () {
var nextPage = "app/tests/pages/navigation/pageC-new-activity";
var nextPage = "tests/pages/navigation/pageC-new-activity";
frame.topmost().navigate(nextPage);
});
stack.addChild(btn);

View File

@ -14,7 +14,7 @@ export function createPage() {
var btn = new button.Button();
btn.text = "Page C";
btn.on(button.knownEvents.tap, function () {
var nextPage = "app/tests/pages/navigation/pageC";
var nextPage = "tests/pages/navigation/pageC";
frame.topmost().navigate(nextPage);
});
stack.addChild(btn);
@ -23,7 +23,7 @@ export function createPage() {
btnActivity.text = "start activity";
btnActivity.on(button.knownEvents.tap, function () {
var newFrame = new frame.Frame();
var newPage = "app/tests/pages/navigation/pageA-new-activity";
var newPage = "tests/pages/navigation/pageA-new-activity";
newFrame.navigate(newPage);
});
stack.addChild(btnActivity);
@ -54,4 +54,4 @@ export function createPage() {
page.content = stack;
return page;
}
//export var Page = page;
//export var Page = page;

View File

@ -11,7 +11,7 @@ export function createPage() {
var btn = new button.Button();
btn.text = "Page A ???";
btn.on(button.knownEvents.tap, function () {
var newPage = "app/tests/pages/navigation/pageA";
var newPage = "tests/pages/navigation/pageA";
frame.topmost().navigate(newPage);
});
stack.addChild(btn);

View File

@ -12,7 +12,7 @@ export function createPage() {
newActivity.text = "start activity";
newActivity.on(button.knownEvents.tap, function () {
var newFrame = new frame.Frame();
var newPage = "app/tests/pages/navigation/pageA-new-activity";
var newPage = "tests/pages/navigation/pageA-new-activity";
newFrame.navigate(newPage);
});
stack.addChild(newActivity);
@ -20,7 +20,7 @@ export function createPage() {
var btn = new button.Button();
btn.text = "Page A ???";
btn.on(button.knownEvents.tap, function () {
var nextPage = "app/tests/pages/navigation/pageA";
var nextPage = "tests/pages/navigation/pageA";
frame.topmost().navigate(nextPage);
});
stack.addChild(btn);

View File

@ -7,6 +7,6 @@
<Image src="http://www.google.com/images/errors/logo_sm_2.png" stretch="none" horizontalAlignment="left"/>
<Label text="app file:" />
<Image src="~/app/logo.png" stretch="none" horizontalAlignment="left" />
<Image src="~/logo.png" stretch="none" horizontalAlignment="left" />
</StackLayout>
</Page>

View File

@ -10,5 +10,5 @@ trace.setCategories(trace.categories.concat(
//, trace.categories.VisualTreeEvents
));
application.mainModule = "app/styling/mainPage";
application.mainModule = "styling/mainPage";
application.start();

View File

@ -13,9 +13,9 @@ import ImageModule = require("ui/image");
// <!--Bind the image source property to view-model property -->
// {%raw%}<Image src="{{ thumbnailImageUrl }}" />{%endraw%}
// <!--Load form image from application -->
// <Image source="~/app/logo.png" stretch ="none" / >
// <Image source="~/logo.png" stretch ="none" / >
// <!--Load form image resource -->
// <Image source="res://app/logo.png" stretch ="none" / >
// <Image source="res://logo.png" stretch ="none" / >
// <!--Load form image URL-->
// <Image source="http://www.google.com/images/errors/logo_sm_2.png" stretch ="none" />
// </StackLayout>
@ -106,7 +106,7 @@ export var test_SettingImageSrcToFileWithinApp = function (done) {
// ### How to create an image and set its src to file within the application.
// ``` JavaScript
var image = new ImageModule.Image();
image.src = "~/app/logo.png";
image.src = "~/logo.png";
// ```
// </snippet>

View File

@ -477,7 +477,7 @@ export var testLocalTextAlignmentFromCssWhenAddingCssFileAllSelectorsAreApplied
view.id = "testLabel";
var page = <page.Page>views[1];
page.addCss("#testLabel { text-align: " + expectedTextAlignment + "; }");
page.addCssFile("/app/tests/ui/label/label-tests.css");
page.addCssFile("/tests/ui/label/label-tests.css");
var actualResult = view.style.textAlignment;
// actual result is taken from #testLabel tag, because it has a greater priority (id vs type).
@ -513,7 +513,7 @@ export var testErrorMessageWhenWrongCssIsAddedWithFile = function () {
view.id = "testLabel";
var page = <page.Page>views[1];
errorMessage = undefined;
page.addCssFile("/app/tests/ui/label/label-tests-wrong.css");
page.addCssFile("/tests/ui/label/label-tests-wrong.css");
TKUnit.assertNotEqual(errorMessage, undefined);
});

View File

@ -237,7 +237,7 @@ export var test_FrameBackStack_WhenNavigatingForwardAndBack = function () {
}
export var test_LoadPageFromModule = function () {
helper.navigateToModule("app/ui/page/test-page-module");
helper.navigateToModule("ui/page/test-page-module");
try {
var topFrame = FrameModule.topmost();
TKUnit.assert(topFrame.currentPage.content instanceof LabelModule.Label, "Content of the test page should be a Label created within test-page-module.");

View File

@ -1,3 +1,3 @@
import application = require("application");
application.mainModule = "app/xml-declaration/mainPage";
application.mainModule = "xml-declaration/mainPage";
application.start();

View File

@ -1,6 +1,6 @@
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="MyPageLoaded"
xmlns:customControls="app/xml-declaration/mymodule"
xmlns:customControls2="app/xml-declaration/mymodulewithxml">
xmlns:customControls="xml-declaration/mymodule"
xmlns:customControls2="xml-declaration/mymodulewithxml">
<TabView>
<TabView.items>
<TabViewItem title="Tab 1">
@ -59,4 +59,4 @@
</TabViewItem>
</TabView.items>
</TabView>
</Page>
</Page>

View File

@ -1,4 +1,4 @@
<StackLayout xmlns:customControls="app/xml-declaration/mymodule">
<StackLayout xmlns:customControls="xml-declaration/mymodule">
<Label id="Label1" text="mymodulewithxml" />
<Button text="Click!" tap="buttonTap2" />
</StackLayout>