diff --git a/webapp/src/components/FinalResult/FinalResult.test.js b/webapp/src/components/FinalResult/FinalResult.test.js new file mode 100644 index 00000000..b2df63ee --- /dev/null +++ b/webapp/src/components/FinalResult/FinalResult.test.js @@ -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(); + const resultText = getByText(`You answered ${result} question correct out of ${quizLength}.`); + expect(resultText).toBeInTheDocument(); + }) +}) \ No newline at end of file