Files
ReadMeABook/tests/components/requests/StatusBadge.test.tsx
T
kikootwo 31bca0052f 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.
2026-01-28 11:42:00 -05:00

24 lines
754 B
TypeScript

/**
* Component: Status Badge Tests
* Documentation: documentation/frontend/components.md
*/
// @vitest-environment jsdom
import React from 'react';
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { StatusBadge } from '@/components/requests/StatusBadge';
describe('StatusBadge', () => {
it('uses the initializing label for zero-progress downloads', () => {
render(<StatusBadge status="downloading" progress={0} />);
expect(screen.getByText('Initializing...')).toBeInTheDocument();
});
it('falls back to the raw status when unknown', () => {
render(<StatusBadge status="custom_status" />);
expect(screen.getByText('custom_status')).toBeInTheDocument();
});
});