fix: update test to reflect that unmatched torrents should not be displayed
Build and Push Docker Image / build (push) Successful in 34s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 29s
CI / Security audit (push) Successful in 46s
CI / Tests & coverage (push) Successful in 55s

This commit is contained in:
2026-05-21 00:50:33 +01:00
parent 6124ec0f5a
commit d12356e8f3
+5 -6
View File
@@ -803,7 +803,7 @@ describe('buildUserDownloads', () => {
}); });
}); });
it('sets canBlocklist correctly for non-admin users', () => { it('does not display unmatched torrents', () => {
const cacheSnapshot = { const cacheSnapshot = {
sabnzbdQueue: { data: { queue: { slots: [] } } }, sabnzbdQueue: { data: { queue: { slots: [] } } },
sabnzbdHistory: { data: { history: { slots: [] } } }, sabnzbdHistory: { data: { history: { slots: [] } } },
@@ -819,8 +819,8 @@ describe('buildUserDownloads', () => {
eta: 1200, eta: 1200,
size: 2147483648, size: 2147483648,
savePath: '/downloads/test', savePath: '/downloads/test',
addedOn: new Date(Date.now() - 7200000).toISOString(), // 2 hours ago addedOn: new Date(Date.now() - 7200000).toISOString(),
availability: '50' // Low availability availability: '50'
}] }]
}; };
@@ -836,9 +836,8 @@ describe('buildUserDownloads', () => {
embyUserMap embyUserMap
}); });
expect(result).toHaveLength(1); // Unmatched torrents (not in Sonarr/Radarr queue/history) should not be displayed
// Non-admin with old torrent and low availability should be able to blocklist expect(result).toEqual([]);
expect(result[0].canBlocklist).toBe(true);
}); });
it('includes sonarrLink and radarrLink when available', () => { it('includes sonarrLink and radarrLink when available', () => {