Files
Umbraco-CMS/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/AngularIntegration/JsInitializationTests.cs

34 lines
821 B
C#
Raw Normal View History

// Copyright (c) Umbraco.
// See LICENSE for more details.
using NUnit.Framework;
using Umbraco.Cms.Infrastructure.WebAssets;
using Umbraco.Extensions;
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.Common.AngularIntegration;
[TestFixture]
public class JsInitializationTests
{
[Test]
public void Parse_Main()
{
var result = BackOfficeJavaScriptInitializer.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']);
});
});".StripWhitespace(),
result.StripWhitespace());
}
}