diff --git a/src/components/SongCard.test.tsx b/src/components/SongCard.test.tsx new file mode 100644 index 0000000..b04e6f9 --- /dev/null +++ b/src/components/SongCard.test.tsx @@ -0,0 +1,28 @@ +import React from 'react' +import { render } from '@testing-library/react' +import { vi, describe, it, expect } from 'vitest' +import { SongCard } from './SongCard' +import type { Song } from '../data/songs' + +vi.mock('../hooks/useLyrics', () => ({ + useLyrics: (artist: string, title: string) => ({ + data: { lyrics: `Lyrics for ${artist} - ${title}` }, + isLoading: false, + error: null, + }), +})) + +const song: Song = { + id: 'test-song', + artist: 'Test Artist', + title: 'Test Title', + album: 'Test Album', +} + +describe('SongCard', () => { + it('matches snapshot', () => { + const { asFragment } = render() + + expect(asFragment()).toMatchSnapshot() + }) +})