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
Jan 26, 2018
1 parent
88cf421
commit b521d84
Showing
5 changed files
with
252 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules/ | |
.next/ | ||
lib/ | ||
!db/structure.sql | ||
.env |
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,21 @@ | ||
/* eslint-disable jsx-a11y/label-has-for */ | ||
import React from 'react' | ||
import ReactMarkdown from 'react-markdown' | ||
import 'prismjs' | ||
import Head from 'next/head' | ||
import PrismCode from 'react-prism' | ||
|
||
const code = { code: PrismCode } | ||
const Answer = ({ answer }) => ( | ||
<div> | ||
<Head> | ||
<link rel="stylesheet" href="/prism.css" /> | ||
</Head> | ||
<label> | ||
<input type="radio" /> | ||
{<ReactMarkdown source={answer} renderer={code} />} | ||
</label> | ||
</div> | ||
) | ||
|
||
export default Answer |
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 { shallow } from 'enzyme' | ||
import React from 'react' | ||
import Answer from './Answer' | ||
|
||
describe('#Answer', () => { | ||
it('should render an answer component', () => { | ||
const wrapper = shallow(<Answer answer="2 + 2 = 4" />) | ||
expect(wrapper.find('ReactMarkdown').prop('source')).toEqual('2 + 2 = 4') | ||
}) | ||
}) |
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
Oops, something went wrong.