Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing React element for debugID warning when using .html() #559

Closed
neekey opened this issue Aug 24, 2016 · 3 comments
Closed

Missing React element for debugID warning when using .html() #559

neekey opened this issue Aug 24, 2016 · 3 comments

Comments

@neekey
Copy link

neekey commented Aug 24, 2016

I encountered these errors when using html():

 [Component] Setup
    ✓ should show invalid tip if prop msg is `MEMBERSHIP_TOKEN_INVALID`
Warning: ReactComponentTreeDevtool: Missing React element for debugID 81 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 81 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 81 when building stack
    ✓ should show token expire tip if prop msg is `MEMBERSHIP_TOKEN_EXPIRED`
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 85 when building stack
    ✓ should show membership confirmed tip if prop msg is `MEMBERSHIP_CONFIRMED`
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
Warning: ReactComponentTreeDevtool: Missing React element for debugID 95 when building stack
    ✓ should show membership already confirmed tip if prop msg is `MEMBERSHIP_ALREADY_CONFIRMED`

my test code:

import React from 'react';
import { shallow } from 'enzyme';
import { expect } from 'chai';
import Setup from './comp.Setup';
import SetUpError from './comp.SetupError';

describe('[Component] Setup', () => {
  it('should show invalid tip if prop msg is `MEMBERSHIP_TOKEN_INVALID`', () => {
    const wrapper = shallow(<Setup msg="MEMBERSHIP_TOKEN_INVALID" />);

    expect(wrapper.find(SetUpError).html())
      .to.have.string('Invalid invitation link, please make sure you have used the correct link.');
  });

  it('should show token expire tip if prop msg is `MEMBERSHIP_TOKEN_EXPIRED`', () => {
    const wrapper = shallow(<Setup msg="MEMBERSHIP_TOKEN_EXPIRED" />);

    expect(wrapper.find(SetUpError).html())
      .to.have.string('You invitation link is expired.');
  });

  it('should show membership confirmed tip if prop msg is `MEMBERSHIP_CONFIRMED`', () => {
    const wrapper = shallow(<Setup msg="MEMBERSHIP_CONFIRMED" />);

    expect(wrapper.find(SetUpError).html())
      .to.have.string('You have joined the team successfully!');
  });

  it('should show membership already confirmed tip ' +
    'if prop msg is `MEMBERSHIP_ALREADY_CONFIRMED`', () => {
    const wrapper = shallow(<Setup msg="MEMBERSHIP_ALREADY_CONFIRMED" />);

    expect(wrapper.find(SetUpError).html())
      .to.have.string('You are already a member');
  });
});

React 15.3.0, enzyme 2.4.1

@blainekasten
Copy link
Contributor

@neekey could you provide your component code?

cc @gaearon Do you know why this would show up here?

@gaearon
Copy link
Contributor

gaearon commented Aug 29, 2016

Please verify both react, react-dom and react-addons-test-utils are (at least) 15.3.1.
There were bugs that caused this in earlier versions.
If you can reproduce this with 15.3.1, please file an issue with a project reproducing it.

@ljharb
Copy link
Member

ljharb commented Aug 29, 2016

If that's the case, enzyme should probably modify its peer dep range to require 15.3.1 or higher in the 15.x range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants