mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
more fixes & tests added
This commit is contained in:
@@ -50,6 +50,31 @@ export function test_loadWithOptionsNoXML() {
|
||||
TKUnit.assert(v instanceof view.View, "Expected result: View; Actual result: " + v + ";");
|
||||
};
|
||||
|
||||
export function test_loadWithOptionsNoXML_CSSIsApplied() {
|
||||
var newPage: page.Page;
|
||||
var pageFactory = function (): page.Page {
|
||||
newPage = new page.Page();
|
||||
|
||||
newPage.content = builder.load({
|
||||
path: "~/xml-declaration/mymodule",
|
||||
name: "MyControl",
|
||||
exports: exports,
|
||||
page: newPage
|
||||
});
|
||||
|
||||
return newPage;
|
||||
};
|
||||
|
||||
helper.navigate(pageFactory);
|
||||
TKUnit.assert(newPage.isLoaded, "The page should be loaded here.");
|
||||
try {
|
||||
helper.assertViewBackgroundColor(newPage.content, "#FF0000");
|
||||
}
|
||||
finally {
|
||||
helper.goBack();
|
||||
}
|
||||
};
|
||||
|
||||
export function test_loadWithOptionsWithXML() {
|
||||
var v = builder.load({
|
||||
path: "~/xml-declaration/mymodulewithxml",
|
||||
@@ -59,6 +84,31 @@ export function test_loadWithOptionsWithXML() {
|
||||
TKUnit.assert(v instanceof view.View, "Expected result: View; Actual result: " + v + ";");
|
||||
};
|
||||
|
||||
export function test_loadWithOptionsWithXML_CSSIsApplied() {
|
||||
var newPage: page.Page;
|
||||
var pageFactory = function (): page.Page {
|
||||
newPage = new page.Page();
|
||||
|
||||
newPage.content = builder.load({
|
||||
path: "~/xml-declaration/mymodulewithxml",
|
||||
name: "MyControl",
|
||||
exports: exports,
|
||||
page: newPage
|
||||
});
|
||||
|
||||
return newPage;
|
||||
};
|
||||
|
||||
helper.navigate(pageFactory);
|
||||
TKUnit.assert(newPage.isLoaded, "The page should be loaded here.");
|
||||
try {
|
||||
helper.assertViewBackgroundColor(newPage.content, "#008000");
|
||||
}
|
||||
finally {
|
||||
helper.goBack();
|
||||
}
|
||||
};
|
||||
|
||||
export function test_loadWithOptionsFromTNS() {
|
||||
var v = builder.load({
|
||||
path: "ui/label",
|
||||
|
||||
Reference in New Issue
Block a user