Skip to content

scryRenderedDOMComponentsWithClass broke between 0.14-rc1 and 0.14 #5076

@EvHaus

Description

@EvHaus

The scryRenderedDOMComponentsWithClass function isn't quite working for me anymore after upgrading from 0.14-rc1 and 0.14.

import ReactTestUtils from 'react-addons-test-utils';

const definition = (
    <Spinner text={text} />
);

const spinner = ReactTestUtils.renderIntoDocument(definition);

// This line fails
ReactTestUtils.findRenderedDOMComponentWithClass(spinner, 'ui-spinner');

The error stack looks something like this:

TypeError: ReactDOM.findDOMNode(...).className.split is not a function
    at http://localhost:8080/build/spec.js:29942:63
    at findAllInRenderedTreeInternal (http://localhost:8080/build/spec.js:29828:14)
    at findAllInRenderedTreeInternal (http://localhost:8080/build/spec.js:29837:25)
    at findAllInRenderedTreeInternal (http://localhost:8080/build/spec.js:29840:23)
    at Object.ReactTestUtils.findAllInRenderedTree (http://localhost:8080/build/spec.js:29928:13)
    at Object.ReactTestUtils.scryRenderedDOMComponentsWithClass (http://localhost:8080/build/spec.js:29940:28)
    at ReactTestUtils.findRenderedDOMComponentWithClass (http://localhost:8080/build/spec.js:29958:31)
    at Object.<anonymous> (http://localhost:8080/build/spec.js:51892:17)
    at attemptSync (http://localhost:8080/test/jasmine-2.2.0/jasmine.js:1741:24)
    at QueueRunner.run (http://localhost:8080/test/jasmine-2.2.0/jasmine.js:1729:9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions