From 6e23745af83f957acd129cd98e204c94c06ea0ae Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Wed, 4 Mar 2015 13:26:24 +0200 Subject: [PATCH] image url with "~/" test added --- apps/tests/ui/image/image-tests.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/tests/ui/image/image-tests.ts b/apps/tests/ui/image/image-tests.ts index 02aad972e..c37438ecd 100644 --- a/apps/tests/ui/image/image-tests.ts +++ b/apps/tests/ui/image/image-tests.ts @@ -92,6 +92,33 @@ export var test_SettingImageUrl = function (done) { setTimeout(() => { helper.buildUIAndRunTest(image, testFunc) }, 3000); } +export var test_SettingImageUrlToFileWithinApp = function (done) { + // + // ### How to create an image and set its url to file within the application. + // ``` JavaScript + var image = new ImageModule.Image(); + image.url = "~/app/small-image.png"; + // ``` + // + + var imageIsLoaded = false; + + var testFunc = function (views: Array) { + var testImage = views[0]; + imageIsLoaded = !!testImage.source; + try { + TKUnit.assert(imageIsLoaded === true, "Expected: true, Actual: " + imageIsLoaded); + done(null); + } + catch (e) { + done(e); + } + } + + // wait for a second in order to download the image. + setTimeout(() => { helper.buildUIAndRunTest(image, testFunc) }, 3000); +} + export var test_SettingStretch_AspectFit = function () { // // ### How to set image stretching.