feat(templates): add service language template management
Add normalized service and template catalogs, scoped administration, migration, validation, and regression coverage. Ref: IT-1601
This commit is contained in:
@@ -3,30 +3,12 @@ namespace HrynCo.NotificationService.Web.IntegrationTests;
|
||||
public sealed class AdminTemplatesIndexViewTests
|
||||
{
|
||||
[Fact]
|
||||
public void CreateAndEditLinks_UseExplicitFilterQueryInterpolation()
|
||||
public void CreateAndEditLinks_KeepTheirServiceAndKeyFilter()
|
||||
{
|
||||
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");
|
||||
string view = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "TestViews", "Index.cshtml"));
|
||||
Assert.Contains("asp-route-serviceId=\"@serviceId\"", view);
|
||||
Assert.Contains("asp-route-keyFilter=\"@keyFilter\"", view);
|
||||
Assert.Contains("new { serviceId, definitionId = template.Id, keyFilter }", view);
|
||||
Assert.DoesNotContain("/admin/templates", view);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user