mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Rename the files
This commit is contained in:
30
tests/app/ui/html-view/html-view-tests.ts
Normal file
30
tests/app/ui/html-view/html-view-tests.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import TKUnit = require("../../TKUnit");
|
||||
import helper = require("../helper");
|
||||
import types = require("utils/types");
|
||||
|
||||
// >> htmlview-require
|
||||
import htmlViewModule = require("ui/html-view");
|
||||
// << htmlview-require
|
||||
|
||||
var _createHtmlViewFunc = function (): htmlViewModule.HtmlView {
|
||||
// >> htmlview-create
|
||||
var htmlView = new htmlViewModule.HtmlView();
|
||||
// << htmlview-create
|
||||
return htmlView;
|
||||
}
|
||||
|
||||
export var testLoadHTMLString = function () {
|
||||
let page = helper.getCurrentPage();
|
||||
let htmlView = _createHtmlViewFunc();
|
||||
page.content = htmlView;
|
||||
|
||||
// >> htmlview-using
|
||||
htmlView.html = '<span><font color="#ff0000">Test</font></span>';
|
||||
// << htmlview-using
|
||||
|
||||
if (htmlView.ios) {
|
||||
TKUnit.assert(!types.isNullOrUndefined(htmlView.ios.attributedText), "HTML string not loaded properly. Actual: " + htmlView.ios.attributedText);
|
||||
} else if (htmlView.android) {
|
||||
TKUnit.assert(htmlView.android.getText(), "HTML string not loaded properly. Actual: " + htmlView.android.getText());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user