Skip to content

Commit

Permalink
Missing imports and incorrect style access (#919)
Browse files Browse the repository at this point in the history
The final example was missing imports for the Box component, and was showing the access of the div's style from props, but it's not a component.
  • Loading branch information
philraj authored and darthtrevino committed Mar 9, 2018
1 parent 4beec55 commit 60ee308
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/00 Quick Start/Testing.md
Expand Up @@ -104,6 +104,7 @@ var TestBackend = require('react-dnd-test-backend');
var DragDropContext = require('react-dnd').DragDropContext;
var TestUtils = require('react-dom/test-utils');
var expect = require('expect');
var Box = require('./components/Box');

/**
* Wraps a component into a DragDropContext that uses the TestBackend.
Expand Down Expand Up @@ -143,7 +144,7 @@ it('can be tested with the testing backend', function () {

// Verify that the div changed its opacity
div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
expect(div.props.style.opacity).toEqual(0.4);
expect(div.style.opacity).toEqual(0.4);

// See other backend.simulate* methods for more!
});
Expand All @@ -155,6 +156,7 @@ import TestBackend from 'react-dnd-test-backend';
import { DragDropContext } from 'react-dnd';
import TestUtils from 'react-dom/test-utils';
import expect from 'expect';
import Box from './components/Box';

/**
* Wraps a component into a DragDropContext that uses the TestBackend.
Expand Down Expand Up @@ -187,7 +189,7 @@ it('can be tested with the testing backend', () => {

// Verify that the div changed its opacity
div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
expect(div.props.style.opacity).toEqual(0.4);
expect(div.style.opacity).toEqual(0.4);

// See other backend.simulate* methods for more!
});
Expand All @@ -199,6 +201,7 @@ import TestBackend from 'react-dnd-test-backend';
import { DragDropContext } from 'react-dnd';
import TestUtils from 'react-dom/test-utils';
import expect from 'expect';
import Box from './components/Box';

/**
* Wraps a component into a DragDropContext that uses the TestBackend.
Expand Down Expand Up @@ -232,7 +235,7 @@ it('can be tested with the testing backend', () => {

// Verify that the div changed its opacity
div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
expect(div.props.style.opacity).toEqual(0.4);
expect(div.style.opacity).toEqual(0.4);

// See other backend.simulate* methods for more!
});
Expand Down

0 comments on commit 60ee308

Please sign in to comment.