Commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { render, screen } from '@testing-library/svelte';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import Footer from './Footer.svelte';
|
||||
import { homepageContent } from '$lib/content/homepage';
|
||||
|
||||
describe('Footer', () => {
|
||||
it('adds the About Us link when footer content omits it', () => {
|
||||
const footer = {
|
||||
...homepageContent.footer,
|
||||
navigationLinks: homepageContent.footer.navigationLinks.filter((link) => link.href !== '/about')
|
||||
};
|
||||
|
||||
render(Footer, { footer });
|
||||
|
||||
const aboutLinks = screen.getAllByRole('link', { name: 'About Us' });
|
||||
|
||||
expect(aboutLinks).toHaveLength(1);
|
||||
expect(aboutLinks[0]).toHaveAttribute('href', '/about');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user