fix: update test to reflect that unmatched torrents should not be displayed
This commit is contained in:
@@ -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', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user