Fakultas Ilmu Komputer UI

Commit 39170b0f authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

[#140382397] #4 mencoba bikin testing untuk server.jsx

parent ed86e5a1
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-addons-test-utils' // ES6
import expect from 'expect';
import Root from '../root';
describe('root', function () {
it('renders without problems', function () {
let root = ReactTestUtils.renderIntoDocument(<Root/>);
expect(root).toExist();
});
it('changes without problems', function () {
let root = ReactTestUtils.renderIntoDocument(<Root/>);
const inputNode = ReactDOM.findDOMNode(root.refs.input);
const newValue = 'some text';
inputNode.value = newValue;
ReactTestUtils.Simulate.change(inputNode);
const nameNode = ReactDOM.findDOMNode(root.refs.name);
expect(nameNode.textContent).toEqual(newValue);
});
});
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment