Files
goodgo-platform/apps/web/components/ui/__tests__/label.spec.tsx
Ho Ngoc Hai ccb82fddf8 feat(cache): implement Redis caching for search & analytics hot paths
- 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>
2026-04-08 22:51:16 +07:00

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');
});
});