fix(central-ui): Test Run banner says Notify is simulated; sandbox Send logs it (#151)

The Test Run banner in TemplateScriptDialog and SharedScriptForm claimed
External, Database and Notify all fire for real ("real emails"). Notify
is SandboxNotifyTarget, which returns a random GUID and sends nothing.
The banner now says External/Database are real and Notify is simulated,
pointing at Flow Debugger on a deployed instance for a real send. The
sandbox Send also writes a [sandbox] ... not delivered line to the
console pane. Notify.Status is unchanged (reports Unknown). Tests pin
the banner wording and the console line; Component-CentralUI.md notes
the simulated Notify.
This commit is contained in:
Joseph Doherty
2026-11-28 06:55:04 -05:00
parent 607ffc2e15
commit 8010fee2d2
6 changed files with 53 additions and 11 deletions
@@ -674,6 +674,29 @@ public class ScriptAnalysisServiceTests
Assert.Equal("\"Unknown\"", result.ReturnValueJson);
}
/// <summary>
/// Gitea #151: the sandbox Notify.Send delivers nothing, so it must say so in the
/// Test Run console pane, and still return a fake NotificationId (a 32-hex GUID).
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task RunInSandbox_NotifySend_WritesNotDeliveredLine_AndReturnsFakeId()
{
var result = await _svc.RunInSandboxAsync(
new SandboxRunRequest(
"return await Notify.To(\"ops\").Send(\"subj\", \"body\");",
Parameters: null,
TimeoutSeconds: null),
CancellationToken.None);
Assert.True(result.Success);
Assert.Contains(
"[sandbox] Notify.To(\"ops\").Send not delivered — Test Run does not send notifications",
result.ConsoleOutput);
var id = System.Text.Json.JsonSerializer.Deserialize<string>(result.ReturnValueJson!);
Assert.True(Guid.TryParseExact(id, "N", out _));
}
/// <summary>Verifies that the sandbox captures console output.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]