test(web): assert approvedAt date is rendered in SearchResults
This commit is contained in:
@@ -34,10 +34,12 @@ describe('SearchResults', () => {
|
|||||||
expect(screen.getByText(/42/)).toBeInTheDocument();
|
expect(screen.getByText(/42/)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows sender name and group name for each hit', () => {
|
it('shows sender name, group name, and formatted date for each hit', () => {
|
||||||
render(<SearchResults hits={[makeHit('m1', 'Test')]} total={1} q="test" page={1} />);
|
render(<SearchResults hits={[makeHit('m1', 'Test')]} total={1} q="test" page={1} />);
|
||||||
expect(screen.getByText(/alice/i)).toBeInTheDocument();
|
expect(screen.getByText(/alice/i)).toBeInTheDocument();
|
||||||
expect(screen.getByText(/UP Parivar Dallas/i)).toBeInTheDocument();
|
expect(screen.getByText(/UP Parivar Dallas/i)).toBeInTheDocument();
|
||||||
|
// approvedAt: 1748390400000 — verify a date string is rendered (locale-aware)
|
||||||
|
expect(screen.getByText(new Date(1748390400000).toLocaleDateString())).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows tags for each hit', () => {
|
it('shows tags for each hit', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user