Merge pull request #16 from Bouncey/feat/backendTests

Add backend tests
This commit is contained in:
Stuart Taylor
2018-04-17 11:33:04 +01:00
committed by Mrugesh Mohapatra
parent 5f0068e9c8
commit fa68757553
8 changed files with 52 additions and 44 deletions

View File

@@ -14,7 +14,8 @@ import {
challengeTestsSelector,
consoleOutputSelector,
initTests,
updateChallengeMeta
updateChallengeMeta,
backendNS
} from '../redux';
import {
@@ -72,12 +73,7 @@ const options = {
};
export class BackEnd extends PureComponent {
constructor(...props) {
super(...props);
this.handleSubmit = this.handleSubmit.bind(this);
}
componentDidMount() {
componentDidMount() {
const {
initTests,
updateChallengeMeta,
@@ -101,18 +97,17 @@ export class BackEnd extends PureComponent {
updateChallengeMeta(challengeMeta);
}
}
handleSubmit(values) {
console.log('backend', values);
}
render() {
const {
data: { challengeNode: { fields: { blockName }, title, description } },
output,
tests,
submitting
submitting,
executeChallenge
} = this.props;
// TODO: Should be tied to user.isSigned
const buttonCopy = submitting
? 'Submit and go to my next challenge'
: "I've completed this challenge";
@@ -128,9 +123,9 @@ export class BackEnd extends PureComponent {
<Form
buttonText={buttonCopy + '(Ctrl + Enter)'}
formFields={formFields}
id='backend-form'
id={backendNS}
options={options}
submit={this.handleSubmit}
submit={executeChallenge}
/>
</Row>
<Row>