Fixed the currentEntry property to return navigation entry instead of backstack entry

This commit is contained in:
Panayot Cankov
2015-11-30 17:43:57 +02:00
parent 986cf41ff6
commit 0c015820fb
4 changed files with 16 additions and 8 deletions

View File

@@ -9,7 +9,9 @@ var topmost = frameModule.topmost();
import labelModule = require("ui/label");
import pagesModule = require("ui/page");
export var test_DummyTestForSnippetOnly0 = function () {
import TKUnit = require("./TKUnit");
export var ignore_test_DummyTestForSnippetOnly0 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating to a Module
// ``` JavaScript
@@ -18,7 +20,7 @@ export var test_DummyTestForSnippetOnly0 = function () {
// </snippet>
}
export var test_DummyTestForSnippetOnly1 = function () {
export var ignore_test_DummyTestForSnippetOnly1 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating with a Factory Function
// ``` JavaScript
@@ -34,7 +36,7 @@ export var test_DummyTestForSnippetOnly1 = function () {
// </snippet>
}
export var test_DummyTestForSnippetOnly2 = function () {
export var ignore_test_DummyTestForSnippetOnly2 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating with NavigationEntry
// ``` JavaScript
@@ -48,7 +50,7 @@ export var test_DummyTestForSnippetOnly2 = function () {
// </snippet>
}
export var test_DummyTestForSnippetOnly3 = function () {
export var ignore_test_DummyTestForSnippetOnly3 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating Back
// ``` JavaScript
@@ -56,3 +58,8 @@ export var test_DummyTestForSnippetOnly3 = function () {
// ```
// </snippet>
}
export function test_currentEntry() {
var moduleName = frameModule.topmost().currentEntry.moduleName;
TKUnit.assert(moduleName === "tests/app/mainPage" || moduleName === "app/mainPage", "Expected frameModule.topmost().currentEntry.moduleName to return tests/app/mainPage or app/mainPage but instead returned " + moduleName);
}

View File

@@ -40,6 +40,7 @@ allTests["FILE SYSTEM"] = require("./file-system-tests");
allTests["HTTP"] = require("./http-tests");
allTests["XHR"] = require("./xhr-tests");
allTests["FETCH"] = require("./fetch-tests");
allTests["FRAME"] = require("./frame-tests");
allTests["APPLICATION SETTINGS"] = require("./application-settings-tests");
allTests["IMAGE SOURCE"] = require("./image-source-tests");
allTests["TIMER"] = require("./timer-tests");