为了账号安全,请及时绑定邮箱和手机立即绑定

jest+enzyme取不到节点?

jest+enzyme取不到节点?

大话西游666 2019-03-07 15:11:08
报错如下 Expected value to be (using Object.is):      1    Received:      0      12 |       </IntlProvider>      13 |     );    > 14 |     expect(wrapper.find('.fullscreen-modal').length).toBe(1);      15 |   });      16 | });      spec.js如下import React from 'react';import { shallow } from 'enzyme';import { IntlProvider } from 'react-intl';import AllocatingModal from './allocatingModal';describe('AllocatingModal', () => { // eslint-disable-line no-undef  it('render', () => { // eslint-disable-line no-undef    const wrapper = shallow(      <IntlProvider locale="zh">        <AllocatingModal />      </IntlProvider>    );    expect(wrapper.find('.fullscreen-modal').length).toBe(1);  });});jsx如下<Modal        maskClosable={false}        title={title}        width="100%"        wrapClassName="fullscreen-modal"        closable={false}        visible={this.props.visible}        footer={null}      >明明有 为什么取不到呢?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 665 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号