mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 21:00:09 +00:00
31bca0052f
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.
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
/**
|
|
* Component: Setup Wizard Layout Tests
|
|
* Documentation: documentation/setup-wizard.md
|
|
*/
|
|
|
|
// @vitest-environment jsdom
|
|
|
|
import React from 'react';
|
|
import { render, screen } from '@testing-library/react';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
describe('WizardLayout', () => {
|
|
it('renders Plex steps and footer progress', async () => {
|
|
const { WizardLayout } = await import('@/app/setup/components/WizardLayout');
|
|
|
|
render(
|
|
<WizardLayout currentStep={3} totalSteps={10} backendMode="plex">
|
|
<div>Content</div>
|
|
</WizardLayout>
|
|
);
|
|
|
|
expect(screen.getByText('ReadMeABook Setup')).toBeInTheDocument();
|
|
expect(screen.getByText('Plex')).toBeInTheDocument();
|
|
expect(screen.getByText('Finalize')).toBeInTheDocument();
|
|
expect(screen.getByText('Step 3 of 10')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders Audiobookshelf steps based on auth method', async () => {
|
|
const { WizardLayout } = await import('@/app/setup/components/WizardLayout');
|
|
|
|
render(
|
|
<WizardLayout currentStep={2} totalSteps={8} backendMode="audiobookshelf" authMethod="oidc">
|
|
<div>Content</div>
|
|
</WizardLayout>
|
|
);
|
|
|
|
expect(screen.getByText('ABS')).toBeInTheDocument();
|
|
expect(screen.getByText('Auth')).toBeInTheDocument();
|
|
expect(screen.getByText('OIDC')).toBeInTheDocument();
|
|
expect(screen.queryByText('Registration')).toBeNull();
|
|
expect(screen.queryByText('Admin')).toBeNull();
|
|
});
|
|
});
|