Files
Umbraco-CMS/src/Umbraco.Tests/Web/AngularIntegration/JsInitializationTests.cs

39 lines
919 B
C#
Raw Normal View History

using System.Linq;
using NUnit.Framework;
2016-02-17 13:28:11 +01:00
using Umbraco.Core;
using Umbraco.Web.JavaScript;
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class JsInitializationTests
{
[Test]
public void Get_Default_Init()
{
var init = JsInitialization.GetDefaultInitialization();
Assert.IsTrue(init.Any());
}
[Test]
public void Parse_Main()
{
var result = JavaScriptHelper.WriteScript("[World]", "Hello", "Blah");
Assert.AreEqual(@"LazyLoad.js([World], function () {
//we need to set the legacy UmbClientMgr path
2018-09-20 11:27:44 +02:00
if ((typeof UmbClientMgr) !== ""undefined"") {
UmbClientMgr.setUmbracoPath('Hello');
}
jQuery(document).ready(function () {
2018-09-14 00:14:03 +10:00
angular.bootstrap(document, ['Blah']);
});
2016-02-17 13:28:11 +01:00
});".StripWhitespace(), result.StripWhitespace());
}
}
}