Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram). AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan. Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
import PostCard from '../../components/Post/PostCard';
|
|
|
|
const mockPost = {
|
|
id: '1',
|
|
userId: 'user1',
|
|
content: 'Test post content',
|
|
mediaType: 'text',
|
|
user: {
|
|
id: 'user1',
|
|
username: 'testuser',
|
|
avatar: 'https://example.com/avatar.jpg',
|
|
},
|
|
likesCount: 10,
|
|
commentsCount: 5,
|
|
isLiked: false,
|
|
createdAt: new Date().toISOString(),
|
|
};
|
|
|
|
describe('PostCard', () => {
|
|
it('renders post content correctly', () => {
|
|
const { getAllByText, getByText } = render(<PostCard post={mockPost} />);
|
|
expect(getByText('Test post content')).toBeTruthy();
|
|
expect(getAllByText('testuser').length).toBeGreaterThan(0);
|
|
});
|
|
|
|
it('displays like count', () => {
|
|
const { getByText } = render(<PostCard post={mockPost} />);
|
|
expect(getByText(/10/)).toBeTruthy();
|
|
});
|
|
|
|
it('displays comment count', () => {
|
|
const { getByText } = render(<PostCard post={mockPost} />);
|
|
expect(getByText(/5/)).toBeTruthy();
|
|
});
|
|
});
|