Skip to content

Commit

Permalink
test: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Aug 13, 2024
1 parent 1ce6c3b commit fb60f95
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 144 deletions.
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
snapshotSerializers: [require.resolve('enzyme-to-json/serializer')],
};
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
194 changes: 52 additions & 142 deletions tests/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,162 +1,72 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`rc-footer render Footer with columnLayout and backgroundColor 1`] = `
LoadedCheerio {
"0": <footer
class="rc-footer rc-footer-dark"
style="color: red; background-color: transparent;"
<footer
class="rc-footer rc-footer-dark"
style="color: red; background-color: transparent;"
>
<section
class="rc-footer-container"
>
<section
class="rc-footer-container"
class="rc-footer-columns"
style="justify-content: space-between;"
>
<section
class="rc-footer-columns"
style="justify-content: space-between;"
<div
class="rc-footer-column"
>
<div
class="rc-footer-column"
>
<h2>
title
</h2>
</div>
<div
class="rc-footer-column"
>
<h2>
title
</h2>
</div>
</section>
<h2>
title
</h2>
</div>
<div
class="rc-footer-column"
>
<h2>
title
</h2>
</div>
</section>
</footer>,
"_root": LoadedCheerio {
"0": Document {
"children": [
<html>
<head />
<body />
</html>,
],
"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,
},
}
</section>
</footer>
`;

exports[`rc-footer render empty Footer 1`] = `
LoadedCheerio {
"0": <footer
class="rc-footer rc-footer-dark"
>
<section
class="rc-footer-container"
/>
</footer>,
"_root": LoadedCheerio {
"0": Document {
"children": [
<html>
<head />
<body />
</html>,
],
"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,
},
}
<footer
class="rc-footer rc-footer-dark"
>
<section
class="rc-footer-container"
/>
</footer>
`;

exports[`rc-footer render light theme Footer 1`] = `
LoadedCheerio {
"0": <footer
class="rc-footer rc-footer-light"
style="color: red;"
<footer
class="rc-footer rc-footer-light"
style="color: red;"
>
<section
class="rc-footer-container"
>
<section
class="rc-footer-container"
class="rc-footer-columns"
>
<section
class="rc-footer-columns"
<div
class="rc-footer-column"
>
<h2>
title
</h2>
</div>
<div
class="rc-footer-column"
>
<div
class="rc-footer-column"
>
<h2>
title
</h2>
</div>
<div
class="rc-footer-column"
>
<h2>
title
</h2>
</div>
</section>
<h2>
title
</h2>
</div>
</section>
</footer>,
"_root": LoadedCheerio {
"0": Document {
"children": [
<html>
<head />
<body />
</html>,
],
"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,
},
}
</section>
</footer>
`;
2 changes: 1 addition & 1 deletion tests/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down

0 comments on commit fb60f95

Please sign in to comment.