Skip to content

Commit

Permalink
Remove impossible test
Browse files Browse the repository at this point in the history
  • Loading branch information
azro352 committed Dec 7, 2022
1 parent 14f3b4d commit a052c4b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions components/grid/__tests__/index.test.tsx
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { Col, Row } from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
import useResponsiveObserve from '../../_util/responsiveObserve';
import useBreakpoint from '../hooks/useBreakpoint';
import { render, act } from '../../../tests/utils';

Expand Down Expand Up @@ -84,22 +83,6 @@ describe('Grid', () => {
expect(asFragment().firstChild).toMatchSnapshot();
});

it('ResponsiveObserve.unsubscribe should be called when unmounted', () => {
let responsiveObserveRef: any;
const Demo = () => {
const responsiveObserve = useResponsiveObserve();
responsiveObserveRef = responsiveObserve;
return null;
};
render(<Demo />);
const Unmount = jest.spyOn(responsiveObserveRef, 'unsubscribe');
const { unmount } = render(<Row gutter={{ xs: 20 }} />);
act(() => {
unmount();
});
expect(Unmount).toHaveBeenCalled();
});

it('should work correct when gutter is object', () => {
const { container } = render(<Row gutter={{ xs: 20 }} />);
expect(container.querySelector('div')!.style.marginLeft).toEqual('-10px');
Expand Down

0 comments on commit a052c4b

Please sign in to comment.