feat(notification-outbox): add Type field to NotificationList

This commit is contained in:
Joseph Doherty
2026-05-19 00:52:23 -04:00
parent ed7fddb0b5
commit 87ac9b8a4d
3 changed files with 20 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ using ScadaLink.Commons.Entities.Instances;
using ScadaLink.Commons.Entities.Notifications;
using ScadaLink.Commons.Entities.Sites;
using ScadaLink.Commons.Entities.Templates;
using ScadaLink.Commons.Types.Enums;
using ScadaLink.ConfigurationDatabase;
using ScadaLink.ConfigurationDatabase.Repositories;
using ScadaLink.ConfigurationDatabase.Services;
@@ -224,6 +225,17 @@ public class NotificationRepositoryTests : IDisposable
Assert.Null(await _repository.GetNotificationListByIdAsync(list.Id));
}
[Fact]
public async Task NotificationList_PersistsType()
{
var list = new NotificationList("ops") { Type = NotificationType.Email };
await _repository.AddNotificationListAsync(list);
await _repository.SaveChangesAsync();
_context.ChangeTracker.Clear();
var loaded = await _repository.GetListByNameAsync("ops");
Assert.Equal(NotificationType.Email, loaded!.Type);
}
[Fact]
public void Constructor_NullContext_Throws()
{