Skip to content

Commit adda214

Browse files
elibosleyclaude
andcommitted
test(notifications): missing description is valid, not masked
The notification model intentionally relaxed `description` from @isnotempty() to @IsString() so condition/banner notifications (which carry their meaning in the title + Active badge, now stored under active/) aren't masked as invalid — the UI hides the empty line. Update the stale loadNotificationFile test that still asserted the old "missing description -> masked warning" behavior to expect a valid notification (empty description, INFO importance). Fixes the Test API failure on #2033. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 39d46aa commit adda214

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

api/src/unraid-api/graph/resolvers/notifications/loadNotificationsFile.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ importance=not-a-valid-enum`;
242242
expect(result.description).toBe('Test Description');
243243
});
244244

245-
it('should handle missing description field (should return masked warning notification)', async () => {
245+
it('should allow a missing description field (empty is valid, not masked)', async () => {
246246
const mockFileContent = `timestamp=1609459200
247247
event=Test Event
248248
subject=Test Subject
@@ -254,9 +254,13 @@ importance=normal`;
254254
'/test/path/test.notify',
255255
NotificationType.UNREAD
256256
);
257-
// Should be a masked warning notification
258-
expect(result.description).toContain('invalid and cannot be displayed');
259-
expect(result.importance).toBe(NotificationImportance.WARNING);
257+
// A missing description is allowed: condition/banner notifications carry their
258+
// meaning in the title + Active badge, and the UI hides the empty line. It must
259+
// not be masked as invalid.
260+
expect(result.id).toBe('test.notify');
261+
expect(result.description).toBe('');
262+
expect(result.description).not.toContain('invalid and cannot be displayed');
263+
expect(result.importance).toBe(NotificationImportance.INFO);
260264
});
261265

262266
it('should preserve passthrough data from notification file (only known fields)', async () => {

0 commit comments

Comments
 (0)