Skip to content

Commit 1776a0b

Browse files
author
Raice Hannay
committed
don't deep merge props
1 parent 0539064 commit 1776a0b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "Raice Hannay <[email protected]>",
44
"description": "A set of classes to make setting up React components for unit tests easy.",
55
"license": "ISC",
6-
"version": "1.0.7",
6+
"version": "1.0.8",
77
"keywords": [
88
"component",
99
"enzyme",

src/Wrapper.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ComponentType, mount, render, shallow } from "enzyme";
22
import * as React from "react";
3-
import merge from "ts-deepmerge";
43

54
export default class Wrapper<
65
C extends React.ComponentType<any>,
@@ -106,9 +105,11 @@ export default class Wrapper<
106105
};
107106

108107
protected defineProps = () => {
109-
this.mergedProps = merge(this.defaultProps, this.scenarioProps, {
108+
this.mergedProps = {
109+
...this.defaultProps,
110+
...this.scenarioProps,
110111
children: this.scenarioChildren || this.defaultChildren
111-
});
112+
};
112113

113114
return this.mergedProps;
114115
};

src/WrapperWithRedux.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe("WrapperWithRedux", () => {
143143
});
144144

145145
describe("when accessing the store", () => {
146-
let wrapper: ReactWrapper<typeof ConnectedDummy>;
146+
let wrapper: ReturnType<typeof component.mount>;
147147
const payload = "Dispatched value";
148148

149149
it("mounts the component", () => {

0 commit comments

Comments
 (0)