import { render, screen } from '@testing-library/react';
import { useScopedI18n } from '@/i18n/client';
import { DeletedProfileView } from './DeletedProfileView';

vi.mock('@/i18n/client', () => ({
    useScopedI18n: vi.fn().mockReturnValue((term: string) => term),
}));

vi.mock('@/assets/success.svg', () => ({ default: 'success.svg' }));

describe('<DeletedProfileView>', () => {
    describe('scoped i18n', () => {
        it('should recieve correct arguments', () => {
            render(<DeletedProfileView />);

            expect(useScopedI18n).toHaveBeenCalledWith('pages.profile');
        });
    });

    it('should render icon', () => {
        render(<DeletedProfileView />);

        expect(screen.getByRole('presentation')).toBeVisible();
        expect(screen.getByRole('presentation')).toHaveAttribute(
            'src',
            expect.stringMatching(/success.svg/)
        );
    });

    it('should render text', () => {
        render(<DeletedProfileView />);

        expect(screen.getByText('emptyState.deleted')).toBeVisible();
    });
});
