import React from 'react';
import { render } from '~/testUtils/helpers';
import { Text } from '..';

describe('<Text/>', () => {
  it('Renders without crashing', () => {
    const { container } = render(<Text>This is a test text</Text>);
    expect(container).toBeDefined();
  });

  it('Renders the text correctly', () => {
    const { getByText } = render(<Text>This is a test text</Text>);
    expect(getByText('This is a test text')).toBeDefined();
  });

  it('matches a snapshot', () => {
    const { container } = render(
      <Text variant="b2m" color="gray.1">
        Text element content
      </Text>
    );

    expect(container.firstChild).toMatchSnapshot();
  });
});
