This repository has been archived by the owner on Aug 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeason Centaure
committed
Feb 1, 2018
1 parent
7225d84
commit c3a30ce
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const ScoreResult = ({ totalScore, userScore }) => ( | ||
<p>{`Vous avez obtenu ${userScore}/${totalScore} au quiz React.`}</p> | ||
) | ||
|
||
ScoreResult.propTypes = { | ||
totalScore: PropTypes.number, | ||
userScore: PropTypes.number, | ||
} | ||
|
||
export default ScoreResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
import ScoreResult from './ScoreResult' | ||
|
||
describe('ScoreResult', () => { | ||
it('should render the ScoreResult component', () => { | ||
const wrapper = shallow(<ScoreResult totalScore={20} userScore={12} />) | ||
expect(wrapper.text()).toEqual('Vous avez obtenu 12/20 au quiz React.') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters