Skip to content

Commit

Permalink
refactor mount to have new root() method
Browse files Browse the repository at this point in the history
  • Loading branch information
lelandrichardson committed Sep 10, 2017
1 parent 5430b2a commit 2cdc138
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 156 deletions.
20 changes: 10 additions & 10 deletions packages/enzyme-test-suite/test/Debug-spec.jsx
Expand Up @@ -218,7 +218,7 @@ describe('debug', () => {
);
}
}
expect(mount(<Foo id="2" />).debug()).to.eql(
expect(mount(<Foo id="2" />).root().debug()).to.eql(
`<Foo id="2">
<div className="foo">
<span>
Expand All @@ -237,7 +237,7 @@ describe('debug', () => {
);
}
}
expect(mount(<Foo id="2" />).debug()).to.eql(
expect(mount(<Foo id="2" />).root().debug()).to.eql(
`<Foo id="2">
<div>
hello
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('debug', () => {
);
}
}
expect(mount(<Bar id="2" />).debug()).to.eql(
expect(mount(<Bar id="2" />).root().debug()).to.eql(
`<Bar id="2">
<div className="bar">
<span>
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('debug', () => {
}
}

expect(mount(<Bar id="2" />).debug()).to.eql(
expect(mount(<Bar id="2" />).root().debug()).to.eql(
`<Bar id="2">
<div className="bar">
<Foo baz="bax">
Expand All @@ -362,7 +362,7 @@ describe('debug', () => {
<span>Foo</span>
</div>
);
expect(mount(<Foo id="2" />).debug()).to.eql(
expect(mount(<Foo id="2" />).root().debug()).to.eql(
`<Foo id="2">
<div className="foo">
<span>
Expand All @@ -385,7 +385,7 @@ describe('debug', () => {
<Foo baz="bax" />
</div>
);
expect(mount(<Bar id="2" />).debug()).to.eql(
expect(mount(<Bar id="2" />).root().debug()).to.eql(
`<Bar id="2">
<div className="bar">
<span>
Expand Down Expand Up @@ -415,7 +415,7 @@ describe('debug', () => {
<Foo baz="bax" />
</div>
);
expect(mount(<Bar id="2" />).find(Foo).debug()).to.eql(
expect(mount(<Bar id="2" />).root().find(Foo).debug()).to.eql(
`<Foo baz="bax">
<div className="foo">
<span>
Expand All @@ -442,7 +442,7 @@ describe('debug', () => {
</div>
);

expect(mount(<Bar id="2" />).debug()).to.eql(
expect(mount(<Bar id="2" />).root().debug()).to.eql(
`<Bar id="2">
<div className="bar">
<Foo baz="bax">
Expand Down Expand Up @@ -650,7 +650,7 @@ describe('debug', () => {
}
}

expect(mount(<Bar />).debug({ ignoreProps: false })).to.eql(
expect(mount(<Bar />).root().debug({ ignoreProps: false })).to.eql(
`<Bar>
<div className="class1">
<Foo fooVal="baz">
Expand All @@ -665,7 +665,7 @@ describe('debug', () => {
</Bar>`,
);

expect(mount(<Bar />).debug({ ignoreProps: true })).to.eql(
expect(mount(<Bar />).root().debug({ ignoreProps: true })).to.eql(
`<Bar>
<div>
<Foo>
Expand Down

0 comments on commit 2cdc138

Please sign in to comment.