Skip to content

Commit b8a67bb

Browse files
committed
Reimplements test for zoomable prop
1 parent e5862d1 commit b8a67bb

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/Tree/tests/index.test.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -227,22 +227,20 @@ describe('<Tree />', () => {
227227
});
228228

229229

230-
// it('allows zooming in/out according to `props.scaleExtent` if `props.zoomable`', () => {
231-
// const zoomableComponent = mount(
232-
// <Tree
233-
// data={mockData}
234-
// />
235-
// );
236-
// const nonZoomableComponent = mount(
237-
// <Tree
238-
// data={mockData}
239-
// zoomable={false}
240-
// />
241-
// );
242-
//
243-
// zoomableComponent.find('svg').simulate('touchmove');
244-
//
245-
// expect(zoomableComponent.find('svg').prop('transform')).toBeDefined();
246-
// expect(nonZoomableComponent.find('svg').prop('transform')).toBeUndefined();
247-
// });
230+
it('adds the `.rd3t-grabbable` class if `props.zoomable`', () => {
231+
const zoomableComponent = shallow(
232+
<Tree
233+
data={mockData}
234+
/>
235+
);
236+
const nonZoomableComponent = shallow(
237+
<Tree
238+
data={mockData}
239+
zoomable={false}
240+
/>
241+
);
242+
243+
expect(zoomableComponent.find('.rd3t-tree-container').hasClass('rd3t-grabbable')).toBe(true);
244+
expect(nonZoomableComponent.find('.rd3t-tree-container').hasClass('rd3t-grabbable')).toBe(false);
245+
});
248246
});

0 commit comments

Comments
 (0)