Skip to content

Commit

Permalink
FinalResult test added
Browse files Browse the repository at this point in the history
  • Loading branch information
krovostcora committed Mar 14, 2024
1 parent 0193ccd commit ad90098
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions webapp/src/components/FinalResult/FinalResult.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { render } from '@testing-library/react';
import FinalResult from './FinalResult';
import '@testing-library/jest-dom'

describe('FinalResult component', () => {
it ('FinalResult renders without crashing', () => {
const result = 5;
const quizLength = 15;
const { getByText } = render(<FinalResult result={result} quizLength={quizLength} />);
const resultText = getByText(`You answered ${result} question correct out of ${quizLength}.`);
expect(resultText).toBeInTheDocument();
})
})

0 comments on commit ad90098

Please sign in to comment.