File tree Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -143,21 +143,6 @@ describe('<Node />', () => {
143
143
} ) ;
144
144
145
145
146
- it ( 'mutates the node\'s `y` property according to `depthFactor`, when specified' , ( ) => {
147
- const depthFactor = 100 ;
148
- const expectedY = nodeData . depth * depthFactor ;
149
- const renderedComponent = shallow (
150
- < Node
151
- { ...mockProps }
152
- orientation = "vertical"
153
- depthFactor = { depthFactor }
154
- />
155
- ) ;
156
-
157
- expect ( renderedComponent . prop ( 'transform' ) ) . toBe ( `translate(${ nodeData . parent . x } ,${ expectedY } )` ) ;
158
- } ) ;
159
-
160
-
161
146
it ( 'applies its own x/y coords on `transform` once mounted' , ( ) => {
162
147
const fixture = `translate(${ nodeData . y } ,${ nodeData . x } )` ;
163
148
const renderedComponent = mount (
Original file line number Diff line number Diff line change @@ -130,6 +130,24 @@ describe('<Tree />', () => {
130
130
} ) ;
131
131
132
132
133
+ it ( 'mutates each node\'s `y` prop according to `depthFactor` when specified' , ( ) => {
134
+ const depthFactor = 100 ;
135
+ // const expectedY = nodeData.depth * depthFactor;
136
+ const renderedComponent = shallow (
137
+ < Tree
138
+ data = { mockData }
139
+ orientation = "vertical"
140
+ depthFactor = { depthFactor }
141
+ />
142
+ ) ;
143
+
144
+ const { nodes } = renderedComponent . instance ( ) . generateTree ( mockData ) ;
145
+ nodes . forEach ( ( node ) => {
146
+ expect ( node . y ) . toBe ( node . depth * depthFactor ) ;
147
+ } ) ;
148
+ } ) ;
149
+
150
+
133
151
it ( 'passes `props.orientation` to its <Node /> and <Link /> children' , ( ) => {
134
152
const fixture = 'vertical' ;
135
153
const renderedComponent = shallow (
You can’t perform that action at this time.
0 commit comments