UNPKG

@eureca/eureca-ui

Version:

UI component library of Eureca's user and admin apps

30 lines (23 loc) 1.07 kB
import React from 'react'; import { SubmitSolutionCard } from '../submit-solution'; import { render } from '@testing-library/react'; function renderCard(props) { return render(<SubmitSolutionCard onChange={() => {}} {...props} />); } describe('Submit Solution card component', () => { it('has a translated name according to type (arquivo/pdf)', () => { const { getByText } = renderCard({ type: 'pdf', title: 'Arquivo / PDF' }); const translatedName = getByText('Arquivo / PDF'); expect(translatedName).toBeDefined(); }); it('has a translated name according to type (arquivo/audio)', () => { const { getByText } = renderCard({ type: 'audio', title: 'Arquivo / Áudio' }); const translatedName = getByText('Arquivo / Áudio'); expect(translatedName).toBeDefined(); }); it('has a translated name according to type (arquivo/vídeo)', () => { const { getByText } = renderCard({ type: 'video', title: 'Arquivo / Vídeo' }); const translatedName = getByText('Arquivo / Vídeo'); expect(translatedName).toBeDefined(); }); });