Files
Creeer-Web/components/primitives/__tests__/CTA.test.tsx
T

15 lines
559 B
TypeScript

import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { CTA } from '../CTA';
describe('<CTA />', () => {
it('renders the label with arrow', () => {
render(<CTA href="#contacto" label="Define tu siguiente movimiento" />);
expect(screen.getByRole('link', { name: /define tu siguiente movimiento/i })).toBeInTheDocument();
});
it('uses the href', () => {
render(<CTA href="#contacto" label="x" />);
expect(screen.getByRole('link').getAttribute('href')).toBe('#contacto');
});
});