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
import React from "react"; | |
export const Form = ({name, age, onSubmit, onUpdate}) => { | |
return ( | |
<form onSubmit={onSubmit}> | |
<div className="form-group"> | |
<label className="control-label">Name</label> | |
<div className="controls"> | |
<input | |
type="text" |
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
import {add} from "helpers" | |
const calculator = (a, b, op) => { | |
if (op == "+") | |
return add (a, b); | |
} | |
/******************************************************************** | |
When we unit test calculator, we are concerned with whether | |
calculator calls add helper or not if `op` is `+` and not with |
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
import {add} from "helpers" | |
const calculator = (a, b, op) => { | |
if (op == "+") | |
return add (a, b); | |
} | |
/******************************************************************** | |
When we unit test calculator, we are concerned with whether | |
calculator calls add helper or not if `op` is `+` and not with |
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
import {add} from "helpers" | |
const calculator = (a, b, op) => { | |
if (op == "+") | |
return add (a, b); | |
} | |
/******************************************************************** | |
When we unit test calculator, we are concerned with whether | |
calculator calls add helper or not if `op` is `+` and not with |
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
class Form extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
input: "", | |
}; | |
this.onChangeHandler = this.onChangeHandler.bind(this); | |
this.onSubmitHandler = this.onSubmitHandler.bind(this); | |
} |
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
// Person class | |
class Person { | |
sayHello (name) { | |
console.log("Hello" + name + "!"); | |
} | |
} | |
// Person class test cases | |
// - it should print "Hello JS!” if sayHello is called with “JS” ================> PASSED | |
// - it should print “Hello World!” if sayHello is called with no parameters.====> FAILED |
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
/************************************************************************ | |
Helper Method name: transformToEvents. | |
Input: "talent-job-associations" object | |
{ | |
type: "associations", | |
job: {...}, // Job Object | |
talentId: "1", | |
associations: [{ | |
status: "Interested", |
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
/************************************************************************ | |
Helper Method name: transformToEvents. | |
Input: talent-job-associations object | |
{ | |
type: "associations", | |
job: {...}, // Job Object | |
talentId: "1", | |
associations: [{ | |
status: "Interested", |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://unpkg.com/react@15/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> | |
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://unpkg.com/react@15/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> | |
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script> |
NewerOlder