Skip to content

Commit

Permalink
[Tests] add test case for #2019
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 20, 2019
1 parent ad00682 commit 2c17e1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ describeWithDOM('mount', () => {
expect(wrapper.children().props().bam).to.equal(true);
});

it('works with numeric literals', () => {
const wrapper = mount(<div>{50}</div>);
expect(wrapper.debug()).to.equal(`<div>
50
</div>`);
});

it('calls ref', () => {
const spy = sinon.spy();
mount(<div ref={spy} />);
Expand Down
7 changes: 7 additions & 0 deletions packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ describe('shallow', () => {
expect(wrapper.children().props().bam).to.equal(undefined);
});

it('works with numeric literals', () => {
const wrapper = shallow(<div>{50}</div>);
expect(wrapper.debug()).to.equal(`<div>
50
</div>`);
});

describe('wrapping invalid elements', () => {
it('throws with combined dangerouslySetInnerHTML and children on host nodes', () => {
/* eslint react/no-danger-with-children: 0 */
Expand Down

0 comments on commit 2c17e1f

Please sign in to comment.