Skip to content

Commit

Permalink
fix: shallow snapshots with decorators [no issue] (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau authored and reviewflow[bot] committed May 6, 2019
1 parent 2d467f7 commit e98bf4e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions @ornikar/jest-config-react/__mocks__/@storybook/react.js
Expand Up @@ -85,16 +85,13 @@ exports.storiesOf = groupName => {
expect(shallowToJson(child.dive())).toMatchSnapshot();
});
} else {
let belowWrapper = true;
const toJsonMap = json => {
if (!belowWrapper) return { ...json, props: {} };
if (json.type === 'JestStoryWrapper') {
belowWrapper = false;
}
return json;
};
expect(
shallowToJson(wrapper, { map: toJsonMap })
shallowToJson(
wrapper
.find(JestStoryWrapper)
.children()
.shallow()
)
).toMatchSnapshot();
}
});
Expand Down

0 comments on commit e98bf4e

Please sign in to comment.