Files
kikootwo 2cda6decbe Add multi-download-client support and UI management
Implements support for configuring both qBittorrent and SABnzbd simultaneously, including migration from legacy config, protocol-aware routing, and protocol filtering. Adds new CRUD API routes for download clients, new UI management components, and updates setup and settings flows to use the new multi-client architecture. Updates documentation to describe the new structure and usage.
2026-01-29 09:21:33 -05:00

32 lines
887 B
TypeScript

/**
* Component: Modal Component 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 { Modal } from '@/components/ui/Modal';
describe('Modal', () => {
it('locks body scroll while open and closes on escape', () => {
const onClose = vi.fn();
const { unmount } = render(
<Modal isOpen onClose={onClose} title="Test Modal">
<div>Modal Content</div>
</Modal>
);
expect(screen.getByText('Modal Content')).toBeInTheDocument();
expect(document.body.style.overflow).toBe('hidden');
fireEvent.keyDown(document, { key: 'Escape' });
expect(onClose).toHaveBeenCalledTimes(1);
unmount();
expect(document.body.style.overflow).toBe(''); // Cleared to default
});
});