fix: admin bugs from the audit: a playback-error delete no longer reports failure, a failed Overview load no longer reads as all-clear, and email settings can't be saved over with defaults (M503 #5604)
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m31s
release / go (push) Successful in 1m49s
release / integration (push) Successful in 5m20s
release / Build signed APK (releases and dev) (push) Successful in 5m9s
release / android (push) Successful in 6m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m31s
release / go (push) Successful in 1m49s
release / integration (push) Successful in 5m20s
release / Build signed APK (releases and dev) (push) Successful in 5m9s
release / android (push) Successful in 6m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
- Playback errors: Delete file stops resolving the error row the track deletion already took with it (ON DELETE CASCADE), which 404'd into "Delete failed". - Overview: a queue that fails to load says so with Try again, and its tile shows a dash, not 0. Delete via Lidarr shows only for an album Lidarr holds while Lidarr is connected. An approve refreshes the Collection. - Quarantine: Delete via Lidarr is in the row menu, so a phone reaches it; "1 report", not "1 reports". - Duplicates: the Keep badge follows the copy picked. - Integrations: provider save failures and load errors are said, not swallowed or shown as "No providers registered"; the Lidarr test catches a failed call; SMTP fills once and Save stays off until it has loaded. Lidarr's blurb says what it is still used for. - Requests: release profiles point at Collection › Following. - Library: an empty library sends an admin to Admin to run a scan, and tells anyone else the admin scans it, instead of opening Settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { afterEach, describe, expect, test, vi } from 'vitest';
|
||||
import { cleanup, render, screen } from '@testing-library/svelte';
|
||||
import { readable } from 'svelte/store';
|
||||
import { apiClientMock } from '../../../test-utils/mocks/client';
|
||||
|
||||
vi.mock('#lib/api/albums.js', () => ({
|
||||
createAlbumsAlphaInfiniteQuery: () =>
|
||||
readable({
|
||||
data: { pages: [{ items: [], total: 0, limit: 50, offset: 0 }] },
|
||||
isPending: false,
|
||||
isError: false,
|
||||
hasNextPage: false,
|
||||
isFetchingNextPage: false,
|
||||
refetch: () => {},
|
||||
fetchNextPage: () => {}
|
||||
}),
|
||||
ALBUM_PAGE_SIZE: 50
|
||||
}));
|
||||
vi.mock('#lib/api/client.js', () => apiClientMock());
|
||||
|
||||
import Page from './+page.svelte';
|
||||
import { setUser } from '#lib/auth/user.svelte.js';
|
||||
import type { User } from '#lib/api/client.js';
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
setUser(null);
|
||||
});
|
||||
|
||||
// Library folders are server config, not a setting (#5604): the empty
|
||||
// library no longer sends anyone to Settings.
|
||||
describe('/library/albums with an empty library', () => {
|
||||
test('an admin is sent to Admin to run a scan', () => {
|
||||
setUser({ id: 'u1', username: 'root', is_admin: true } as User);
|
||||
render(Page);
|
||||
expect(screen.getByRole('link', { name: /run a scan/i }).getAttribute('href')).toBe('/admin');
|
||||
expect(screen.queryByRole('link', { name: /open settings/i })).toBeNull();
|
||||
});
|
||||
|
||||
test('anyone else is told the admin scans the library, with no link', () => {
|
||||
setUser({ id: 'u2', username: 'alice', is_admin: false } as User);
|
||||
render(Page);
|
||||
expect(screen.getByText(/your server's admin has scanned the library/i)).toBeInTheDocument();
|
||||
expect(screen.queryByRole('link')).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user