Add series fields to audiobooks and update related logic

Introduces 'series' and 'seriesPart' fields to the Audiobook model and database schema. Updates API routes, file organization, and path template utilities to support series metadata. Enhances chapter merging logic, improves notification backend testing, and expands test coverage for admin and API routes.
This commit is contained in:
kikootwo
2026-01-22 15:56:55 -05:00
parent dc7e557694
commit 31bca0052f
105 changed files with 10384 additions and 75 deletions
@@ -0,0 +1,38 @@
/**
* Component: Available Indexer Row Tests
* Documentation: documentation/frontend/components.md
*/
// @vitest-environment jsdom
import { describe, expect, it, vi } from 'vitest';
import { fireEvent, render, screen } from '@testing-library/react';
import { AvailableIndexerRow } from '@/components/admin/indexers/AvailableIndexerRow';
describe('AvailableIndexerRow', () => {
const indexer = {
id: 1,
name: 'Test Indexer',
protocol: 'torrent',
supportsRss: true,
};
it('renders an add button when the indexer is not added', () => {
const onAdd = vi.fn();
render(<AvailableIndexerRow indexer={indexer} isAdded={false} onAdd={onAdd} />);
fireEvent.click(screen.getByRole('button', { name: 'Add' }));
expect(onAdd).toHaveBeenCalledTimes(1);
expect(screen.getByText('Test Indexer')).toBeInTheDocument();
expect(screen.getByText('torrent')).toBeInTheDocument();
});
it('renders the added state when already configured', () => {
render(<AvailableIndexerRow indexer={indexer} isAdded onAdd={vi.fn()} />);
expect(screen.getByText('Added')).toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Add' })).toBeNull();
});
});