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 = {
|
||||
sabnzbdQueue: { data: { queue: { slots: [] } } },
|
||||
sabnzbdHistory: { data: { history: { slots: [] } } },
|
||||
@@ -819,8 +819,8 @@ describe('buildUserDownloads', () => {
|
||||
eta: 1200,
|
||||
size: 2147483648,
|
||||
savePath: '/downloads/test',
|
||||
addedOn: new Date(Date.now() - 7200000).toISOString(), // 2 hours ago
|
||||
availability: '50' // Low availability
|
||||
addedOn: new Date(Date.now() - 7200000).toISOString(),
|
||||
availability: '50'
|
||||
}]
|
||||
};
|
||||
|
||||
@@ -836,9 +836,8 @@ describe('buildUserDownloads', () => {
|
||||
embyUserMap
|
||||
});
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
// Non-admin with old torrent and low availability should be able to blocklist
|
||||
expect(result[0].canBlocklist).toBe(true);
|
||||
// Unmatched torrents (not in Sonarr/Radarr queue/history) should not be displayed
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('includes sonarrLink and radarrLink when available', () => {
|
||||
|
||||
Reference in New Issue
Block a user