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,48 @@
/**
* Component: Delete Confirm Modal 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 { DeleteConfirmModal } from '@/components/admin/indexers/DeleteConfirmModal';
describe('DeleteConfirmModal', () => {
it('confirms removal and closes the modal', () => {
const onClose = vi.fn();
const onConfirm = vi.fn();
render(
<DeleteConfirmModal
isOpen
onClose={onClose}
onConfirm={onConfirm}
indexerName="TrackerOne"
/>
);
fireEvent.click(screen.getByRole('button', { name: 'Remove Indexer' }));
expect(onConfirm).toHaveBeenCalledTimes(1);
expect(onClose).toHaveBeenCalledTimes(1);
});
it('closes without confirming when canceled', () => {
const onClose = vi.fn();
render(
<DeleteConfirmModal
isOpen
onClose={onClose}
onConfirm={vi.fn()}
indexerName="TrackerTwo"
/>
);
fireEvent.click(screen.getByRole('button', { name: 'Cancel' }));
expect(onClose).toHaveBeenCalledTimes(1);
});
});