mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
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.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user