1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-02-14 21:10:41 +01:00
portfolio/src/components/molecules/ProjectLinks.test.jsx

25 lines
652 B
JavaScript

import React from 'react'
import { render } from '@testing-library/react'
import ProjectLinks from './ProjectLinks'
describe('ProjectLinks', () => {
const links = [
{
title: 'my project',
type: 'website',
url: 'https://hello.com'
}
]
it('renders correctly', () => {
const { container, getByTestId } = render(<ProjectLinks links={links} />)
expect(container.firstChild).toBeInTheDocument()
expect(getByTestId('link').nodeName).toBe('A')
expect(getByTestId('link').textContent).toBe('my project')
expect(getByTestId('link').attributes.href.textContent).toBe(
'https://hello.com'
)
})
})