From 66539ff0db6c98c61e1736cff09c84754eab1790 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Thu, 10 Aug 2017 15:05:57 +0200 Subject: [PATCH] Use wrapper.debug for snapshot tests --- .../__snapshots__/classnames.js.snap | 116 ++++++++++-------- .../tests/component/classnames.js | 15 +-- 2 files changed, 72 insertions(+), 59 deletions(-) diff --git a/packages/devtools-reps/src/object-inspector/tests/component/__snapshots__/classnames.js.snap b/packages/devtools-reps/src/object-inspector/tests/component/__snapshots__/classnames.js.snap index 73d14be14..aa6d1d4ea 100644 --- a/packages/devtools-reps/src/object-inspector/tests/component/__snapshots__/classnames.js.snap +++ b/packages/devtools-reps/src/object-inspector/tests/component/__snapshots__/classnames.js.snap @@ -1,60 +1,76 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ObjectInspector - classnames has the expected class 1`] = ` - +" + +
+ +
+
+ + root + + + : + + + 42 + +
+
+
+
+
+
" `; exports[`ObjectInspector - classnames has the inline class when inline prop is true 1`] = ` - +" + +
+ +
+
+ + root + + + : + + + 42 + +
+
+
+
+
+
" `; exports[`ObjectInspector - classnames has the nowrap class when disableWrap prop is true 1`] = ` - +" + +
+ +
+
+ + root + + + : + + + 42 + +
+
+
+
+
+
" `; diff --git a/packages/devtools-reps/src/object-inspector/tests/component/classnames.js b/packages/devtools-reps/src/object-inspector/tests/component/classnames.js index ac0557ba0..811c8050f 100644 --- a/packages/devtools-reps/src/object-inspector/tests/component/classnames.js +++ b/packages/devtools-reps/src/object-inspector/tests/component/classnames.js @@ -23,32 +23,29 @@ function generateDefaults(overrides) { describe("ObjectInspector - classnames", () => { it("has the expected class", () => { const props = generateDefaults(); - const oi = ObjectInspector(props); - const wrapper = mount(oi); + const wrapper = mount(ObjectInspector(props)); expect(wrapper.hasClass("tree")).toBeTruthy(); expect(wrapper.hasClass("inline")).toBeFalsy(); expect(wrapper.hasClass("nowrap")).toBeFalsy(); - expect(oi).toMatchSnapshot(); + expect(wrapper.debug()).toMatchSnapshot(); }); it("has the nowrap class when disableWrap prop is true", () => { const props = generateDefaults({ disableWrap: true, }); - const oi = ObjectInspector(props); - const wrapper = mount(oi); + const wrapper = mount(ObjectInspector(props)); expect(wrapper.hasClass("nowrap")).toBeTruthy(); - expect(oi).toMatchSnapshot(); + expect(wrapper.debug()).toMatchSnapshot(); }); it("has the inline class when inline prop is true", () => { const props = generateDefaults({ inline: true, }); - const oi = ObjectInspector(props); - const wrapper = mount(oi); + const wrapper = mount(ObjectInspector(props)); expect(wrapper.hasClass("inline")).toBeTruthy(); - expect(oi).toMatchSnapshot(); + expect(wrapper.debug()).toMatchSnapshot(); }); });