diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..66a2c87 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + snapshotSerializers: [require.resolve('enzyme-to-json/serializer')], +}; diff --git a/src/index.tsx b/src/index.tsx index be040c1..92a191e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import classNames from 'classnames'; -import Column, { type FooterColumn } from './column'; +import Column from './column'; +import type { FooterColumn } from './column'; export interface FooterProps { prefixCls?: string; diff --git a/tests/__snapshots__/index.spec.tsx.snap b/tests/__snapshots__/index.spec.tsx.snap index 2276b24..4d82071 100644 --- a/tests/__snapshots__/index.spec.tsx.snap +++ b/tests/__snapshots__/index.spec.tsx.snap @@ -1,162 +1,72 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`rc-footer render Footer with columnLayout and backgroundColor 1`] = ` -LoadedCheerio { - "0": , - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} + + `; exports[`rc-footer render empty Footer 1`] = ` -LoadedCheerio { - "0": , - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} + `; exports[`rc-footer render light theme Footer 1`] = ` -LoadedCheerio { - "0": , - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} + + `; diff --git a/tests/index.spec.tsx b/tests/index.spec.tsx index ce4c8e6..90218a4 100644 --- a/tests/index.spec.tsx +++ b/tests/index.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { mount } from 'enzyme'; -import Footer from '../index'; +import Footer from '../src'; describe('rc-footer', () => { it('render empty Footer', () => {