|
|
|
@ -16,6 +16,7 @@ using Microsoft.Extensions.Options; |
|
|
|
using Squidex.Domain.Apps.Core.Contents; |
|
|
|
using Squidex.Domain.Apps.Core.Scripting; |
|
|
|
using Squidex.Domain.Apps.Core.Scripting.Extensions; |
|
|
|
using Squidex.Infrastructure; |
|
|
|
using Squidex.Infrastructure.Security; |
|
|
|
using Squidex.Infrastructure.Validation; |
|
|
|
using Xunit; |
|
|
|
@ -288,7 +289,6 @@ namespace Squidex.Domain.Apps.Core.Operations.Scripting |
|
|
|
getJSON('http://squidex.io', function(result) {
|
|
|
|
data.operation = { iv: result.key }; |
|
|
|
}); |
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => sut.TransformAsync(context, script, contentOptions)); |
|
|
|
@ -438,5 +438,24 @@ namespace Squidex.Domain.Apps.Core.Operations.Scripting |
|
|
|
|
|
|
|
Assert.False(result); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Should_handle_domain_id_as_string() |
|
|
|
{ |
|
|
|
var id = DomainId.NewGuid(); |
|
|
|
|
|
|
|
const string script = @"
|
|
|
|
return value; |
|
|
|
";
|
|
|
|
|
|
|
|
var context = new ScriptVars |
|
|
|
{ |
|
|
|
["value"] = id |
|
|
|
}; |
|
|
|
|
|
|
|
var result = sut.Execute(context, script); |
|
|
|
|
|
|
|
Assert.Equal(id.ToString(), result.ToString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|