- Add TTL-specific cache durations: district stats (5min), market report (15min), heatmap (5min) - Add Redis caching to GeoSearch handler with 60s TTL - Add cache invalidation on listing.approved, listing.updated, listing.deactivated, listing.sold events - Invalidate search, geo_search, and all analytics cache prefixes on listing state changes - Update tests for new CacheService dependency in event handler and geo-search handler Co-Authored-By: Paperclip <noreply@paperclip.ing>
26 lines
751 B
TypeScript
26 lines
751 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { Label } from '../label';
|
|
|
|
describe('Label', () => {
|
|
it('renders label text', () => {
|
|
render(<Label>Số điện thoại</Label>);
|
|
expect(screen.getByText('Số điện thoại')).toBeInTheDocument();
|
|
});
|
|
|
|
it('associates with input via htmlFor', () => {
|
|
render(
|
|
<>
|
|
<Label htmlFor="phone">Phone</Label>
|
|
<input id="phone" />
|
|
</>,
|
|
);
|
|
expect(screen.getByLabelText('Phone')).toBeInTheDocument();
|
|
});
|
|
|
|
it('applies custom className', () => {
|
|
render(<Label data-testid="label" className="custom">Label</Label>);
|
|
expect(screen.getByTestId('label')).toHaveClass('custom');
|
|
});
|
|
});
|