feat(sms): NotificationLists Type column (S8)

This commit is contained in:
Joseph Doherty
2026-06-19 10:51:11 -04:00
parent 73df322a66
commit 58ac06a358
2 changed files with 53 additions and 0 deletions
@@ -45,6 +45,7 @@
<thead class="table-light">
<tr>
<th>Name</th>
<th>Type</th>
<th>Recipients</th>
<th class="text-end">Actions</th>
</tr>
@@ -56,6 +57,7 @@
?? (IReadOnlyList<NotificationRecipient>)Array.Empty<NotificationRecipient>();
<tr @key="list.Id">
<td>@list.Name</td>
<td>@list.Type</td>
<td>
@if (recipients.Count == 0)
{
@@ -7,6 +7,7 @@ using NSubstitute;
using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared;
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
using NotificationListsPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.NotificationLists;
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages;
@@ -98,6 +99,56 @@ public class NotificationListsPageTests : BunitContext
});
}
[Fact]
public void RendersTypeColumn_Sms()
{
var repo = Substitute.For<INotificationRepository>();
repo.GetAllNotificationListsAsync()
.Returns(Task.FromResult<IReadOnlyList<NotificationList>>(
new List<NotificationList>
{
new("SMS Alerts") { Id = 2, Type = NotificationType.Sms }
}));
repo.GetRecipientsByListIdAsync(2)
.Returns(Task.FromResult<IReadOnlyList<NotificationRecipient>>(
new List<NotificationRecipient>()));
Services.AddSingleton(repo);
WireAuthAndDialog();
var cut = Render<NotificationListsPage>();
cut.WaitForAssertion(() =>
{
Assert.Contains("SMS Alerts", cut.Markup);
Assert.Contains("Sms", cut.Markup);
});
}
[Fact]
public void RendersTypeColumn_Email()
{
var repo = Substitute.For<INotificationRepository>();
repo.GetAllNotificationListsAsync()
.Returns(Task.FromResult<IReadOnlyList<NotificationList>>(
new List<NotificationList>
{
new("Email Alerts") { Id = 3, Type = NotificationType.Email }
}));
repo.GetRecipientsByListIdAsync(3)
.Returns(Task.FromResult<IReadOnlyList<NotificationRecipient>>(
new List<NotificationRecipient>()));
Services.AddSingleton(repo);
WireAuthAndDialog();
var cut = Render<NotificationListsPage>();
cut.WaitForAssertion(() =>
{
Assert.Contains("Email Alerts", cut.Markup);
Assert.Contains("Email", cut.Markup);
});
}
/// <summary>A dialog service that auto-confirms, so action paths run end-to-end.</summary>
private sealed class AlwaysConfirmDialogService : IDialogService
{