Slide 96
Slide 96 text
Demo1-‐test.jsx
it("should
increment
the
counter
when
clicking
on
the
+
button",
function()
{
var
demo1
=
TestUtils
.renderIntoDocument();
var
plusButton
=
TestUtils
.scryRenderedDOMComponentsWithTag(demo1,
'button’)
.filter(function(component)
{
return
component.getDOMNode().textContent
===
'+’
})[0];
TestUtils.Simulate.click(plusButton)
expect(demo1.getDOMNode().textContent).toBe('-‐1+');
});