Browse Source

delete duplicate custom button spec file

Tumao 4 years ago
parent
commit
3853c7545d
1 changed files with 0 additions and 39 deletions
  1. 0 39
      client/src/components/__test__/customButton/customButton.spec.tsx

+ 0 - 39
client/src/components/__test__/customButton/customButton.spec.tsx

@@ -1,39 +0,0 @@
-import { render, unmountComponentAtNode } from 'react-dom';
-import { act } from 'react-dom/test-utils';
-import CustomButton from '../../customButton/CustomButton';
-
-let container: any = null;
-
-jest.mock('@material-ui/core/Button', () => {
-  return props => {
-    const { variant, children } = props;
-    return (
-      <>
-        <div className="variant">{variant}</div>
-        <button className="button">{children}</button>;
-      </>
-    );
-  };
-});
-
-describe('Test CustomButton', () => {
-  beforeEach(() => {
-    container = document.createElement('div');
-    document.body.appendChild(container);
-  });
-
-  afterEach(() => {
-    unmountComponentAtNode(container);
-    container.remove();
-    container = null;
-  });
-
-  test('test button props', () => {
-    act(() => {
-      render(<CustomButton variant="contained">test</CustomButton>, container);
-    });
-
-    expect(container.querySelector('.button').textContent).toBe('test');
-    expect(container.querySelector('.variant').textContent).toBe('contained');
-  });
-});