refactor: Refactor UI structure

This commit is contained in:
deytenit committed 2026-02-01 01:49:02 +03:00
1 parent bbb9503172
commit ca20310460
33 files changed
+435 -247

No files matched your search

@@ -0,0 +1,18 @@
import React from 'react';
import { Link } from './Link';
import { render, screen } from '../../../test-utils';
describe('components/generic/Link', () => {
it('renders correctly as a link when href is provided', () => {
render(<Link href="https://example.com">Click me</Link>);
const link = screen.getByRole('link', { name: 'Click me' });
expect(link).toHaveAttribute('href', 'https://example.com');
expect(link).toHaveClass('text-[var(--rb-ring)]');
});
it('renders as a button/span when no href is provided but has onPress', () => {
render(<Link onPress={() => {}}>Click me</Link>);
expect(screen.getByText('Click me')).toBeInTheDocument();
});
});