|
1 | 1 | import { mount } from 'enzyme';
|
2 | 2 | import * as React from 'react';
|
3 | 3 | import toJson from 'enzyme-to-json';
|
4 |
| -import Drawer from "../src"; |
| 4 | +import Drawer from '../src'; |
5 | 5 |
|
6 | 6 | function Div(props) {
|
7 | 7 | const { show, ...otherProps } = props;
|
@@ -29,21 +29,6 @@ function DrawerComp(props: { open?: boolean }) {
|
29 | 29 | );
|
30 | 30 | }
|
31 | 31 |
|
32 |
| -function TowDrawer(props: { oneOpen?: boolean; towOpen?: boolean }) { |
33 |
| - return ( |
34 |
| - <div className="tow-wrapper"> |
35 |
| - <div |
36 |
| - id="a" |
37 |
| - className="a" |
38 |
| - style={{ position: 'absolute', top: 0, left: 0 }} |
39 |
| - > |
40 |
| - <Drawer getContainer="#a" open={props.oneOpen} /> |
41 |
| - </div> |
42 |
| - <Drawer open={props.towOpen} /> |
43 |
| - </div> |
44 |
| - ); |
45 |
| -} |
46 |
| - |
47 | 32 | function createClientXY(x: number, y: number) {
|
48 | 33 | return { clientX: x, clientY: y };
|
49 | 34 | }
|
@@ -232,27 +217,4 @@ describe('rc-drawer-menu', () => {
|
232 | 217 | });
|
233 | 218 | expect(toJson(instance.render())).toMatchSnapshot();
|
234 | 219 | });
|
235 |
| - it.only('tow drawer getContainer', () => { |
236 |
| - instance = mount(<TowDrawer />); |
237 |
| - jest.useFakeTimers(); |
238 |
| - instance.setProps({ |
239 |
| - oneOpen: true, |
240 |
| - }); |
241 |
| - jest.runAllTimers(); |
242 |
| - expect(document.body.style.cssText).toEqual(''); |
243 |
| - console.log(document.body.style.cssText); |
244 |
| - instance.setProps({ |
245 |
| - towOpen: true, |
246 |
| - }); |
247 |
| - jest.runAllTimers(); |
248 |
| - console.log(document.body.style.cssText); |
249 |
| - expect(document.body.style.cssText).toBe('overflow: hidden;'); |
250 |
| - instance.setProps({ |
251 |
| - towOpen: false, |
252 |
| - }); |
253 |
| - jest.runAllTimers(); |
254 |
| - console.log(document.body.style.cssText); |
255 |
| - expect(document.body.style.cssText).toEqual(''); |
256 |
| - jest.useRealTimers(); |
257 |
| - }); |
258 | 220 | });
|
0 commit comments