Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/rc-cli/cjs/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const DEFAULT_CONFIG = {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!**/demo/**', '!**/test/**'],
coverageDirectory: './tests/coverage',
snapshotSerializers: ['enzyme-to-json/serializer'],
};

function readRootConfig() {
Expand Down
3 changes: 0 additions & 3 deletions packages/rc-cli/cjs/jest.setup.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
const Enzyme = require('enzyme');
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17');

Enzyme.configure({ adapter: new Adapter() });
3 changes: 0 additions & 3 deletions packages/rc-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@testing-library/react": "^12.1.2",
"@vant/touch-emulator": "^1.3.2",
"@vitejs/plugin-react": "^2.0.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
"address": "^1.1.2",
"autoprefixer": "9.7.5",
"babel-plugin-import": "^1.13.1",
Expand All @@ -52,8 +51,6 @@
"commander": "^9.4.0",
"consola": "^2.15.3",
"conventional-changelog": "^3.1.24",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.1",
"esbuild": "^0.14.54",
"execa": "^5.1.1",
"fast-glob": "^3.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/rc-ui-lib/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ module.exports = {
'!**/**/PropsType.ts',
'!**/test/**',
],
// testMatch: ['**/badge/__test__/**/*.[jt]s?(x)'],
// testMatch: ['**/image-preview/__test__/**/*.spec.[jt]s?(x)'],
};
2 changes: 0 additions & 2 deletions packages/rc-ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
"@rancui/cli": "workspace:*",
"@rancui/linter": "workspace:*",
"@testing-library/react": "^12.1.2",
"@types/enzyme": "^3.10.12",
"@types/enzyme-to-json": "^1.5.4",
"@types/jest": "^27.0.3",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,83 +1,116 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Popup should allow to custom close icon with closeIcon prop 1`] = `
Array [
<Icon
className="rc-action-sheet__close"
name="success"
onClick={[Function]}
tag="i"
<div
class="rc-popup rc-popup--round rc-popup--bottom rc-safe-area-bottom rc-action-sheet"
style="z-index: 2000; transition-duration: 300ms;"
>
<div
class="rc-action-sheet__header"
>
<Badge
className="rc-action-sheet__close van-icon van-icon-success"
onClick={[Function]}
position="top-right"
showZero={true}
style={
Object {
"color": undefined,
"fontSize": undefined,
}
}
tag="i"
Title
<i
class="rc-badge__wrapper rc-action-sheet__close van-icon van-icon-success"
/>
</div>
<div
class="rc-action-sheet__content"
/>
</div>
`;

exports[`Popup should allow to custom close icon with closeIcon prop 2`] = `
<div
class="rc-popup rc-popup--round rc-popup--bottom rc-safe-area-bottom rc-action-sheet"
style="z-index: 2000; transition-duration: 300ms;"
>
<div
class="rc-action-sheet__header"
>
Title
<div
class="rc-action-sheet__close"
>
<i
className="rc-badge__wrapper rc-action-sheet__close van-icon van-icon-success"
onClick={[Function]}
style={
Object {
"color": undefined,
"fontSize": undefined,
}
}
/>
</Badge>
</Icon>,
<Badge
className="rc-action-sheet__close van-icon van-icon-success"
onClick={[Function]}
position="top-right"
showZero={true}
style={
Object {
"color": undefined,
"fontSize": undefined,
}
}
tag="i"
<i>
X
</i>
</div>
</div>
<div
class="rc-action-sheet__content"
/>
</div>
`;

exports[`Popup should render default slot correctly 1`] = `
<div
class="rc-popup rc-popup--round rc-popup--bottom rc-safe-area-bottom rc-action-sheet"
style="z-index: 2000; transition-duration: 300ms;"
>
<div
class="rc-action-sheet__header"
>
Title
<i
className="rc-badge__wrapper rc-action-sheet__close van-icon van-icon-success"
onClick={[Function]}
style={
Object {
"color": undefined,
"fontSize": undefined,
}
}
class="rc-badge__wrapper rc-action-sheet__close van-icon van-icon-cross"
/>
</Badge>,
<i
className="rc-badge__wrapper rc-action-sheet__close van-icon van-icon-success"
onClick={[Function]}
style={
Object {
"color": undefined,
"fontSize": undefined,
}
}
/>,
]
</div>
<div
class="rc-action-sheet__content"
>
Default
</div>
</div>
`;

exports[`Popup should render default slot correctly 1`] = `"<div style=\\"z-index: 2000; animation-duration: 300ms;\\" class=\\"rc-overlay\\"></div><div style=\\"z-index: 2000; transition-duration: 300ms;\\" class=\\"rc-popup rc-popup--round rc-popup--bottom rc-safe-area-bottom rc-action-sheet\\"><div class=\\"rc-action-sheet__header\\">Title<i class=\\"rc-badge__wrapper rc-action-sheet__close van-icon van-icon-cross\\"></i></div><div class=\\"rc-action-sheet__content\\">Default</div></div>"`;

exports[`Popup should render description correctly 1`] = `
<div
className="rc-action-sheet__description"
class="rc-popup rc-popup--round rc-popup--bottom rc-safe-area-bottom rc-action-sheet"
style="z-index: 2000; transition-duration: 300ms;"
>
This is a description
<div
class="rc-action-sheet__description"
>
This is a description
</div>
<div
class="rc-action-sheet__content"
/>
</div>
`;

exports[`Popup should render subname correctly 1`] = `"<button type=\\"button\\" class=\\"rc-action-sheet__item\\"><span class=\\"rc-action-sheet__name\\">Option</span><div class=\\"rc-action-sheet__subname\\">Subname</div></button>"`;
exports[`Popup should render subname correctly 1`] = `
<div
class="rc-popup rc-popup--round rc-popup--bottom rc-safe-area-bottom rc-action-sheet"
style="z-index: 2000; transition-duration: 300ms;"
>
<div
class="rc-action-sheet__content"
>
<button
class="rc-action-sheet__item"
type="button"
>
<span
class="rc-action-sheet__name"
>
Option
</span>
<div
class="rc-action-sheet__subname"
>
Subname
</div>
</button>
</div>
<div
class="rc-action-sheet__gap"
/>
<button
class="rc-action-sheet__cancel"
type="button"
>
Cancel
</button>
</div>
`;
Loading