|
| 1 | +import React from 'react' |
| 2 | +import { render, screen } from '@testing-library/react' |
| 3 | +import '@testing-library/jest-dom/extend-expect' |
| 4 | +import SocialList from '../../../components/Footer/FooterSocialLinks' |
| 5 | + |
| 6 | +describe('SocialList component', () => { |
| 7 | + beforeEach(() => { |
| 8 | + render(<SocialList />) |
| 9 | + }) |
| 10 | + |
| 11 | + it('should render the email social list item', () => { |
| 12 | + const emailIcon = screen.getByAltText('Email icon') |
| 13 | + const emailLink = screen.getByText('Maila oss') |
| 14 | + expect(emailIcon).toBeInTheDocument() |
| 15 | + expect(emailLink).toHaveAttribute('href', 'mailto:[email protected]') |
| 16 | + }) |
| 17 | + |
| 18 | + it('should render the Twitter social list item', () => { |
| 19 | + const twitterIcon = screen.getByAltText('X (Twitter) logo') |
| 20 | + const twitterLink = screen.getByText('X (Twitter)') |
| 21 | + expect(twitterIcon).toBeInTheDocument() |
| 22 | + expect(twitterLink).toHaveAttribute('href', 'https://twitter.com/klimatkollen') |
| 23 | + }) |
| 24 | + |
| 25 | + it('should render the LinkedIn social list item', () => { |
| 26 | + const linkedInIcon = screen.getByAltText('Linkedin logo') |
| 27 | + const linkedInLink = screen.getByText('LinkedIn') |
| 28 | + expect(linkedInIcon).toBeInTheDocument() |
| 29 | + expect(linkedInLink).toHaveAttribute('href', 'https://www.linkedin.com/company/klimatkollen/') |
| 30 | + }) |
| 31 | + |
| 32 | + it('should render the GitHub social list item', () => { |
| 33 | + const gitHubIcon = screen.getByAltText('GitHub logo') |
| 34 | + const gitHubLink = screen.getByText('GitHub') |
| 35 | + expect(gitHubIcon).toBeInTheDocument() |
| 36 | + expect(gitHubLink).toHaveAttribute('href', 'https://github.com/Klimatbyran/klimatkollen') |
| 37 | + }) |
| 38 | +}) |
0 commit comments