Compare commits
2 Commits
bb0de0f2c1
...
01c622038d
| Author | SHA1 | Date | |
|---|---|---|---|
| 01c622038d | |||
| 1ceb71b9a2 |
@@ -0,0 +1,32 @@
|
||||
namespace HrynCo.NotificationService.Web.IntegrationTests;
|
||||
|
||||
public sealed class AdminTemplatesIndexViewTests
|
||||
{
|
||||
[Fact]
|
||||
public void CreateAndEditLinks_UseExplicitFilterQueryInterpolation()
|
||||
{
|
||||
string view = File.ReadAllText(FindIndexView());
|
||||
|
||||
Assert.Contains("/admin/templates/create@(filterQuery)", view);
|
||||
Assert.Contains("@t.LanguageCode@(filterQuery)", view);
|
||||
Assert.DoesNotContain("create@filterQuery", view);
|
||||
Assert.DoesNotContain("LanguageCode@filterQuery", view);
|
||||
}
|
||||
|
||||
private static string FindIndexView()
|
||||
{
|
||||
DirectoryInfo? directory = new(AppContext.BaseDirectory);
|
||||
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "HrynCo.NotificationService.slnx")))
|
||||
{
|
||||
directory = directory.Parent;
|
||||
}
|
||||
|
||||
Assert.NotNull(directory);
|
||||
return Path.Combine(
|
||||
directory.FullName,
|
||||
"HrynCo.NotificationService.Web",
|
||||
"Views",
|
||||
"AdminTemplates",
|
||||
"Index.cshtml");
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace HrynCo.NotificationService.Web.IntegrationTests;
|
||||
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<div class="page-header">
|
||||
<h2><i class="bi bi-envelope-paper"></i> Email Templates</h2>
|
||||
<a href="/admin/templates/create@filterQuery" class="btn btn-primary btn-sm">
|
||||
<a href="/admin/templates/create@(filterQuery)" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-plus-lg me-1"></i> Create New Template
|
||||
</a>
|
||||
</div>
|
||||
@@ -146,7 +146,7 @@ else
|
||||
<td>@t.LanguageCode</td>
|
||||
<td>@t.Subject</td>
|
||||
<td class="text-end">
|
||||
<a href="/admin/templates/@t.ServiceName/@t.Key/@t.LanguageCode@filterQuery"
|
||||
<a href="/admin/templates/@t.ServiceName/@t.Key/@t.LanguageCode@(filterQuery)"
|
||||
class="btn btn-sm btn-outline-primary me-1">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</a>
|
||||
|
||||
@@ -112,4 +112,10 @@ version.
|
||||
|
||||
Before enabling the Worker, verify that the target service has an active SMTP channel and exact-language templates for every queued ItemTracker template key. Inspect any delayed ItemTracker backlog for expired password-reset, verification, or invitation messages before draining it.
|
||||
|
||||
The template administration list preserves optional Service Name and Key filters when an
|
||||
administrator opens the create or edit screen. These links use explicit Razor expression
|
||||
boundaries so the filter query is appended as query parameters rather than rendered as a
|
||||
literal `@filterQuery` path segment. With no active filters, the create route is exactly
|
||||
`/admin/templates/create`.
|
||||
|
||||
For the smoke test, use an owned test account and a non-sensitive notification template. Record the Outbox `Id` and `CorrelationId`, trigger only one message, follow those identifiers through Outbox publication and Notification Service logs, and confirm receipt with the configured SMTP provider. Do not copy payloads, tokens, credentials, full recipient addresses, or rendered URLs into tickets or logs.
|
||||
|
||||
Reference in New Issue
Block a user