浏览代码

Remove nonsensical snapshots

Marat Adiyatullin 4 年之前
父节点
当前提交
7667149776

+ 3 - 3
kafka-ui-react-app/src/components/Connect/Details/Config/__test__/Config.spec.tsx

@@ -48,9 +48,9 @@ describe('Config', () => {
       expect(wrapper.toJSON()).toMatchSnapshot();
     });
 
-    it('matches snapshot when no config', () => {
-      const wrapper = create(setupWrapper({ config: null }));
-      expect(wrapper.toJSON()).toMatchSnapshot();
+    it('is empty when no config', () => {
+      const wrapper = mount(setupWrapper({ config: null }));
+      expect(wrapper.html()).toEqual('');
     });
 
     it('fetches config on mount', () => {

+ 0 - 2
kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap

@@ -16,5 +16,3 @@ exports[`Config view matches snapshot 1`] = `
 `;
 
 exports[`Config view matches snapshot when fetching config 1`] = `<mock-PageLoader />`;
-
-exports[`Config view matches snapshot when no config 1`] = `null`;

+ 4 - 3
kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/Overview.spec.tsx

@@ -1,5 +1,6 @@
 import React from 'react';
 import { create } from 'react-test-renderer';
+import { mount } from 'enzyme';
 import { containerRendersView } from 'lib/testHelpers';
 import OverviewContainer from 'components/Connect/Details/Overview/OverviewContainer';
 import Overview, {
@@ -27,9 +28,9 @@ describe('Overview', () => {
       expect(wrapper.toJSON()).toMatchSnapshot();
     });
 
-    it('matches snapshot when no connector', () => {
-      const wrapper = create(setupWrapper({ connector: null }));
-      expect(wrapper.toJSON()).toMatchSnapshot();
+    it('is empty when no connector', () => {
+      const wrapper = mount(setupWrapper({ connector: null }));
+      expect(wrapper.html()).toBeNull();
     });
   });
 });

+ 0 - 2
kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap

@@ -62,5 +62,3 @@ exports[`Overview view matches snapshot 1`] = `
   </table>
 </div>
 `;
-
-exports[`Overview view matches snapshot when no connector 1`] = `null`;

+ 3 - 3
kafka-ui-react-app/src/components/Connect/Details/__tests__/Details.spec.tsx

@@ -74,9 +74,9 @@ describe('Details', () => {
       expect(wrapper.toJSON()).toMatchSnapshot();
     });
 
-    it('matches snapshot when no connector', () => {
-      const wrapper = create(setupWrapper({ connector: null }));
-      expect(wrapper.toJSON()).toMatchSnapshot();
+    it('is empty when no connector', () => {
+      const wrapper = mount(setupWrapper({ connector: null }));
+      expect(wrapper.html()).toEqual('');
     });
 
     it('fetches connector on mount', () => {

+ 0 - 2
kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap

@@ -101,5 +101,3 @@ exports[`Details view matches snapshot 1`] = `
 exports[`Details view matches snapshot when fetching connector 1`] = `<mock-PageLoader />`;
 
 exports[`Details view matches snapshot when fetching tasks 1`] = `<mock-PageLoader />`;
-
-exports[`Details view matches snapshot when no connector 1`] = `null`;