mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
a97979358f
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.
31 lines
858 B
TypeScript
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');
|
|
});
|
|
});
|