Skip to content

Commit 5294b9b

Browse files
author
Nedyalko Nikolov
committed
Merge pull request NativeScript#164 from NativeScript/nnikolov/testsFixes
Bindable tests fix.
2 parents 213b4e7 + aa697d1 commit 5294b9b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

apps/tests/ui/bindable-tests.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import stackLayoutModule = require("ui/layouts/stack-layout");
1212
import bindingBuilder = require("ui/builder/binding-builder");
1313
import labelModule = require("ui/label");
1414
import textFieldModule = require("ui/text-field");
15+
import fs = require("file-system");
1516

1617
// <snippet module="ui/core/bindable" title="bindable">
1718
// For information and examples how to use bindings please refer to special [**Data binding**](../../../../bindings.md) topic.
@@ -472,8 +473,8 @@ export var test_TwoElementsBindingToSameBindingContext = function () {
472473
TKUnit.assertEqual(upperStackLabel.text, label1.text);
473474
TKUnit.assertEqual(upperStackLabel.text, label2.text);
474475
}
475-
476-
helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage", null, testFunc);
476+
var moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length);
477+
helper.navigateToModuleAndRunTest(("." + moduleName + "/bindingContext_testPage"), null, testFunc);
477478
}
478479

479480
export var test_BindingContext_NavigatingForwardAndBack = function () {
@@ -483,13 +484,14 @@ export var test_BindingContext_NavigatingForwardAndBack = function () {
483484
var testTextField: textFieldModule.TextField = <textFieldModule.TextField>(childPage.getViewById("testTextField"));
484485
testTextField.text = expectedValue;
485486
};
486-
487-
helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage2", page.bindingContext, innerTestFunc);
487+
var moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length);
488+
helper.navigateToModuleAndRunTest(("." + moduleName + "/bindingContext_testPage2"), page.bindingContext, innerTestFunc);
488489
var testLabel: labelModule.Label = <labelModule.Label>(page.getViewById("testLabel"));
489490
TKUnit.assertEqual(testLabel.text, expectedValue);
490491
}
491492

492-
helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage1", null, testFunc);
493+
var moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length);
494+
helper.navigateToModuleAndRunTest(("." + moduleName + "/bindingContext_testPage1"), null, testFunc);
493495
}
494496

495497
export var test_BindingToSource_FailsAfterBindingContextChange = function () {

0 commit comments

Comments
 (0)