Files
ReadMeABook/tests/app/admin/components/MetricCard.test.tsx
T
kikootwo a97979358f Implement file hash-based library matching and remove fuzzy ASIN matching
Adds file hash-based matching for Audiobookshelf library items to ensure 100% accurate ASIN assignment for RMAB-organized content. Removes fuzzy matching from library availability checks, making all matching ASIN-only to eliminate false positives and race conditions. Updates database schema, processors, and matcher utilities; adds new tests and documentation for the new matching strategy. Removes obsolete scripts, Dockerfile, and related tests; updates docker-compose for test environments.
2026-01-28 11:42:00 -05:00

31 lines
858 B
TypeScript

/**
* Component: Metric Card Tests
* Documentation: documentation/admin-dashboard.md
*/
// @vitest-environment jsdom
import React from 'react';
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { MetricCard } from '@/app/admin/components/MetricCard';
describe('MetricCard', () => {
it('renders title, value, and subtitle with variant styles', () => {
const { container } = render(
<MetricCard
title="Errors"
value={3}
subtitle="Last 24h"
variant="error"
icon={<span>!</span>}
/>
);
expect(screen.getByText('Errors')).toBeInTheDocument();
expect(screen.getByText('3')).toBeInTheDocument();
expect(screen.getByText('Last 24h')).toBeInTheDocument();
expect(container.firstChild).toHaveClass('bg-red-50');
});
});