diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 0b69d73f5..c9d81265f 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -236,6 +236,7 @@ + @@ -1752,7 +1753,7 @@ False - + \ No newline at end of file diff --git a/apps/tests/testRunner.ts b/apps/tests/testRunner.ts index a39c70c74..ce0f61ebc 100644 --- a/apps/tests/testRunner.ts +++ b/apps/tests/testRunner.ts @@ -70,6 +70,7 @@ allTests["LIST-PICKER"] = require("./ui/list-picker/list-picker-tests"); allTests["DATE-PICKER"] = require("./ui/date-picker/date-picker-tests"); allTests["TIME-PICKER"] = require("./ui/time-picker/time-picker-tests"); allTests["WEB-VIEW"] = require("./ui/web-view/web-view-tests"); +allTests["HTML-VIEW"] = require("./ui/html-view/html-view-tests"); allTests["WEAK-EVENTS"] = require("./weak-event-listener-tests"); allTests["REPEATER"] = require("./ui/repeater/repeater-tests"); allTests["SEARCH-BAR"] = require('./ui/search-bar/search-bar-tests'); diff --git a/apps/tests/ui/html-view/html-view-tests.ts b/apps/tests/ui/html-view/html-view-tests.ts new file mode 100644 index 000000000..04c519ac0 --- /dev/null +++ b/apps/tests/ui/html-view/html-view-tests.ts @@ -0,0 +1,56 @@ +import TKUnit = require("../../TKUnit"); +import helper = require("../helper"); +import page = require("ui/page"); +import types = require("utils/types"); + +// +// # WebView +// Using a HtmlView requires the html-view module. +// ``` JavaScript +import htmlViewModule = require("ui/html-view"); +// ``` +// + +// ### Declaring a HtmlView. +//```XML +// +// +// +//``` + +//  + +var _createHtmlViewFunc = function (): htmlViewModule.HtmlView { + // + // ### Creating a HtmlView + // ``` JavaScript + var htmlView = new htmlViewModule.HtmlView(); + // ``` + // + return htmlView; +} + +export var testLoadHTMLString = function () { + var newPage: page.Page; + var htmlView = _createHtmlViewFunc(); + var pageFactory = function (): page.Page { + newPage = new page.Page(); + newPage.content = htmlView; + return newPage; + }; + + helper.navigate(pageFactory); + + // + // ### Using HtmlView + // ``` JavaScript + htmlView.html = 'Test'; + + helper.goBack(); + + 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()); + } +} \ No newline at end of file diff --git a/apps/tests/xml-declaration/mainPage.xml b/apps/tests/xml-declaration/mainPage.xml index d801544c8..46321e44d 100644 --- a/apps/tests/xml-declaration/mainPage.xml +++ b/apps/tests/xml-declaration/mainPage.xml @@ -7,6 +7,8 @@ + +