test/fix(sms): scope S8 Type-column assertion + S9 RetryDelay display (review polish)
This commit is contained in:
@@ -127,12 +127,15 @@ public class NotificationListsPageTests : BunitContext
|
||||
[Fact]
|
||||
public void RendersTypeColumn_Email()
|
||||
{
|
||||
// The list name deliberately contains no channel word so that the only "Email"
|
||||
// in the rendered markup originates from the Type column cell, not the name cell.
|
||||
// This guards against false-passes where the name itself satisfies the assertion.
|
||||
var repo = Substitute.For<INotificationRepository>();
|
||||
repo.GetAllNotificationListsAsync()
|
||||
.Returns(Task.FromResult<IReadOnlyList<NotificationList>>(
|
||||
new List<NotificationList>
|
||||
{
|
||||
new("Email Alerts") { Id = 3, Type = NotificationType.Email }
|
||||
new("Ops Alerts") { Id = 3, Type = NotificationType.Email }
|
||||
}));
|
||||
repo.GetRecipientsByListIdAsync(3)
|
||||
.Returns(Task.FromResult<IReadOnlyList<NotificationRecipient>>(
|
||||
@@ -144,8 +147,15 @@ public class NotificationListsPageTests : BunitContext
|
||||
|
||||
cut.WaitForAssertion(() =>
|
||||
{
|
||||
Assert.Contains("Email Alerts", cut.Markup);
|
||||
Assert.Contains("Email", cut.Markup);
|
||||
// Verify the row name rendered.
|
||||
Assert.Contains("Ops Alerts", cut.Markup);
|
||||
|
||||
// Locate the Type <td> in the rendered table row and assert its text content
|
||||
// is exactly "Email". If the Type column were removed the <td> would not
|
||||
// exist and the assertion would throw, catching the regression.
|
||||
var typeCell = cut.FindAll("tbody tr td")
|
||||
.FirstOrDefault(td => td.TextContent.Trim() == "Email");
|
||||
Assert.NotNull(typeCell);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user