feat: implement project development module, transfer management features, and industrial AVM model integration
This commit is contained in:
21
apps/web/components/listings/__tests__/social-share.spec.tsx
Normal file
21
apps/web/components/listings/__tests__/social-share.spec.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { SocialShare } from '../social-share';
|
||||
|
||||
describe('SocialShare', () => {
|
||||
it('renders Facebook, Zalo and copy-link actions', () => {
|
||||
render(<SocialShare listingId="abc-123" listingTitle="Căn hộ mẫu" />);
|
||||
expect(screen.getByLabelText('Chia sẻ lên Facebook')).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Chia sẻ lên Zalo')).toBeInTheDocument();
|
||||
expect(screen.getByLabelText('Sao chép liên kết')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows the backend QR code image when toggled on', () => {
|
||||
render(<SocialShare listingId="abc-123" listingTitle="Căn hộ mẫu" />);
|
||||
const toggle = screen.getByLabelText('Hiện mã QR');
|
||||
fireEvent.click(toggle);
|
||||
const img = screen.getByAltText('Mã QR cho Căn hộ mẫu') as HTMLImageElement;
|
||||
expect(img).toBeInTheDocument();
|
||||
expect(img.src).toContain('/listings/abc-123/qr-code');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user